repowisefaserf/ha-openwrt

FaserF / ha-openwrt

pythonmainfd1f44c42.8K linessynced 1mo ago

Code health

3.6out of 10At risk

Hotspots average 2.5, the place fixes pay off most.

Explore this codebase

Do next · 3

4 things worth doing in the week to Aug 27, the last indexed commit, 1 of them now.

Worth planning

  • Start breaking up _async_update_device_registry (CCN 108, 293 lines)

    custom_components/openwrt/coordinator.py:1844

    _async_update_device_registry nests deeply; easier to read and change once split; its file is imported by 25 files, changed 52 times in 90 days.

    gain
    up to +0.1 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 108, 293 lines, nests 5 deep
    severity
    high
    worth a check
  • Start breaking up get_wireless_interfaces (CCN 81, 324 lines): first lift lines 186-203

    custom_components/openwrt/api/ubus/network.py:186

    get_wireless_interfaces nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 10 commits; its file is imported by 1 file, changed 17 times in 90 days.

    gain
    up to +0.8 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 81, 324 lines, nests 7 deep
    severity
    high
    worth a check
  • Start breaking up get_connected_devices (CCN 90, 295 lines): first lift lines 238-284

    custom_components/openwrt/api/luci_rpc/devices.py:238

    get_connected_devices nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 6 commits; its file is imported by 1 file, changed 9 times in 90 days.

    gain
    up to +0.5 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 90, 295 lines, nests 9 deep
    severity
    high
    worth a check

Improve what Repowise can see

  • Add a test coverage report

    Without one, Repowise cannot tell tested code from untested code, so every test-related action says “unknown”.

    line coverage
    Unknown, no report

Everything we found

5 areas