rpi-motor-tic249 — Good

Analyzed 2026-03-10 by code2llm  ·  Primary language: python  ·  Python: 17, Shell: 6, TypeScript: 5, JavaScript: 2

281
Functions
17
Classes
19
Files
8,755
Lines
4
Languages
3.8
Avg CC
19
Critical (CC≥10)
2
Duplicates
0
Cycles

Language Distribution

Largest Modules (lines)

Most Complex Modules (functions)

Evolution (2026-03-10)

3.8
CC̄ →
19
Critical →
8755
Lines

Run analysis multiple times to build a trend chart (≥3 data points needed).

Top Modules (30)

ModulePathLinesFuncsClassesCC max
tic_t249_controller.py . 1,456 55 7 39
App.tsx frontend/src 1,204 54 0 46
web_panel.py . 947 37 2 30
motor_controller.py firmware 548 21 1 19
config.py firmware 424 14 1 13
diagnose_usb.py . 348 9 0 18
app.py backend 337 21 0 6
mqtt_client.py firmware 245 13 2 20
example_reciprocate.py . 200 1 0 7
mqtt_bridge.py backend 181 10 1 8
add_config_endpoints.py . 180 0 0 0
cli_shell.py firmware 179 17 1 7
setup.sh . 169 1 0 0
cli_shell.sh . 147 2 0 0
api.ts frontend/src 120 11 1 3
detect_usb.py . 108 3 0 7
log_manager.py backend 93 7 1 6
main.py firmware 91 1 0 8
usb_scanner.py backend 83 2 0 9
run-all.sh scripts 79 2 0 0

Alerts (20)

SeverityTargetTypeValueLimit
critical SettingsPanel high_fan_out 50 10
critical SettingsPanel cc_exceeded 46 15
critical main cc_exceeded 39 15
critical main high_fan_out 38 10
critical api_set_config cc_exceeded 30 15
critical ReciprocateFullPanel high_fan_out 27 10
critical main high_fan_out 23 10
critical websocket_endpoint high_fan_out 23 10
critical FirmwareMQTT._handle_command high_fan_out 23 10
critical loadConfig high_fan_out 22 10
critical c high_fan_out 20 10
error loadConfig cc_exceeded 20 15
error FirmwareMQTT._handle_command cc_exceeded 20 15
error save_dotenv high_fan_out 19 10
error api_set_config high_fan_out 19 10

Hotspots (10)

FunctionFan-outNote
SettingsPanel 50 Orchestrates 50 calls
main 38 Orchestrates 38 calls
ReciprocateFullPanel 27 Orchestrates 27 calls
main 23 Orchestrates 23 calls
websocket_endpoint 23 WebSocket for real-time updates. Receives: {"type": "status"|"log"|"response"|"d
FirmwareMQTT._handle_command 23 Orchestrates 23 calls
loadConfig 22 Orchestrates 22 calls
c 20 Orchestrates 20 calls
save_dotenv 19 Write values back to .env file, preserving comments and structure.
api_set_config 19 Update motor configuration.

Refactoring Priorities (15)

#ActionImpactEffort
1 Split main (CC=39 → target CC<10) high low
2 Split SettingsPanel (CC=46 → target CC<10) high low
3 Split api_set_config (CC=30 → target CC<10) high low
4 Split god module frontend/src/App.tsx (1204L, 0 classes) high high
5 Split god module tic_t249_controller.py (1456L, 7 classes) high high
6 Split god module web_panel.py (947L, 2 classes) high high
7 Split god module firmware/motor_controller.py (548L, 1 classes) high high
8 Split test_movement (CC=18 → target CC<10) medium low
9 Split MotorController._reciprocate_worker (CC=19 → target CC<10) medium low
10 Split ReciprocateFullPanel (CC=16 → target CC<10) medium low
11 Split loadConfig (CC=20 → target CC<10) medium low
12 Split c (CC=19 → target CC<10) medium low
13 Split FirmwareMQTT._handle_command (CC=20 → target CC<10) medium low
14 Reduce SettingsPanel fan-out (currently 50) medium medium
15 Reduce main fan-out (currently 38) medium medium