rpi-motor-tic249 — Good

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

244
Functions
17
Classes
18
Files
6,964
Lines
4
Languages
3.8
Avg CC
17
Critical (CC≥10)
2
Duplicates
0
Cycles

Language Distribution

Largest Modules (lines)

Most Complex Modules (functions)

Evolution (2026-03-10)

3.8
CC̄ →
17
Critical →
6964
Lines

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

Top Modules (28)

ModulePathLinesFuncsClassesCC max
tic_t249_controller.py . 1,456 55 7 39
App.tsx frontend/src 908 28 0 41
web_panel.py . 797 35 2 13
motor_controller.py firmware 533 21 1 19
config.py firmware 378 10 1 13
diagnose_usb.py . 348 9 0 18
app.py backend 284 19 0 3
mqtt_client.py firmware 244 13 2 20
example_reciprocate.py . 200 1 0 7
mqtt_bridge.py backend 181 10 1 8
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
run-all.sh scripts 67 1 0 0
install-deps.sh scripts 43 0 0 0
vite.config.ts frontend 22 0 0 0

Alerts (20)

SeverityTargetTypeValueLimit
critical SettingsPanel high_fan_out 42 10
critical SettingsPanel cc_exceeded 41 15
critical main cc_exceeded 39 15
critical main high_fan_out 38 10
critical ReciprocateFullPanel high_fan_out 24 10
critical main 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 websocket_endpoint high_fan_out 18 10
error test_read_registers high_fan_out 17 10
error main high_fan_out 15 10

Hotspots (10)

FunctionFan-outNote
SettingsPanel 42 Orchestrates 42 calls
main 38 Orchestrates 38 calls
ReciprocateFullPanel 24 Orchestrates 24 calls
main 23 Orchestrates 23 calls
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.
websocket_endpoint 18 WebSocket for real-time updates. Receives: {"type": "status"|"log"|"response"|"d
test_read_registers 17 Test reading registers from Tic.

Refactoring Priorities (15)

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