rpi-motor-tic249 — Good

Analyzed 2026-03-12 by code2llm  ·  Primary language: python  ·  Python: 19, Shell: 7, TypeScript: 6, JavaScript: 2

366
Functions
21
Classes
23
Files
10,708
Lines
4
Languages
3.7
Avg CC
20
Critical (CC≥10)
3
Duplicates
0
Cycles

Language Distribution

Largest Modules (lines)

Most Complex Modules (functions)

Evolution (2026-03-12)

3.7
CC̄ ↓
20
Critical ↑
10708
Lines

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

Top Modules (34)

ModulePathLinesFuncsClassesCC max
tic_t249_controller.py . 1,456 55 7 39
App.tsx frontend/src 1,309 59 0 31
web_panel.py . 947 37 2 30
MotorProgramEditor.tsx frontend/src 691 36 2 12
motor_controller.py firmware 548 21 1 19
cli_shell.py . 482 20 1 21
config.py firmware 427 14 1 13
app.py backend 363 23 0 6
diagnose_usb.py . 348 9 0 18
dsl_logger.py backend 287 18 1 25
mqtt_client.py firmware 245 13 2 20
example_reciprocate.py . 200 1 0 7
cli_shell.py firmware 193 19 1 7
setup.sh . 193 2 0 0
mqtt_bridge.py backend 181 10 1 8
add_config_endpoints.py . 180 0 0 0
cli_shell.sh . 147 2 0 0
api.ts frontend/src 122 11 1 3
detect_usb.py . 108 3 0 7
log_manager.py backend 93 7 1 6

Alerts (20)

SeverityTargetTypeValueLimit
critical SettingsPanel high_fan_out 49 10
critical main cc_exceeded 39 15
critical main high_fan_out 38 10
critical SettingsPanel cc_exceeded 31 15
critical ReciprocateFullPanel high_fan_out 31 10
critical api_set_config cc_exceeded 30 15
critical DSLLogger._convert_to_dsl cc_exceeded 25 15
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 TicShell.execute_command high_fan_out 22 10
critical ReciprocatePanel high_fan_out 20 10
error TicShell.execute_command cc_exceeded 21 15
error ReciprocateFullPanel cc_exceeded 21 15
error FirmwareMQTT._handle_command cc_exceeded 20 15

Hotspots (10)

FunctionFan-outNote
SettingsPanel 49 Orchestrates 49 calls
main 38 Orchestrates 38 calls
ReciprocateFullPanel 31 Orchestrates 31 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
TicShell.execute_command 22 Execute DSL command
ReciprocatePanel 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 DSLLogger._convert_to_dsl (CC=25 → target CC<10) high low
2 Split main (CC=39 → target CC<10) high low
3 Split SettingsPanel (CC=31 → target CC<10) high low
4 Split api_set_config (CC=30 → target CC<10) high low
5 Split god module tic_t249_controller.py (1456L, 7 classes) high high
6 Split god module frontend/src/App.tsx (1309L, 0 classes) high high
7 Split god module web_panel.py (947L, 2 classes) high high
8 Split god module firmware/motor_controller.py (548L, 1 classes) high high
9 Split god module frontend/src/MotorProgramEditor.tsx (691L, 2 classes) high high
10 Split TicShell.execute_command (CC=21 → target CC<10) medium low
11 Split test_movement (CC=18 → target CC<10) medium low
12 Split MotorController._reciprocate_worker (CC=19 → target CC<10) medium low
13 Split ReciprocateFullPanel (CC=21 → target CC<10) medium low
14 Split FirmwareMQTT._handle_command (CC=20 → target CC<10) medium low
15 Reduce SettingsPanel fan-out (currently 49) medium medium