Generated on: 2026-06-02 05:13:58
The repository has moderate technical debt. Consider refactoring the top complexity issues.
draw_ai_activity() lines 656-734: Cog=9, Cyc=9, SLOC=79header_health_span() lines 599-615: Cog=8, Cyc=4, SLOC=17draw_picker() lines 522-594: Cog=7, Cyc=6, SLOC=73draw_log() lines 991-1056: Cog=7, Cyc=6, SLOC=66push_assistant_chat_lines() lines 213-237: Cog=6, Cyc=5, SLOC=25parse_selection_string() lines 305-348: Cog=30, Cyc=16, SLOC=44run() lines 170-224: Cog=15, Cyc=19, SLOC=55setup_terminal_hooks() lines 570-603: Cog=7, Cyc=8, SLOC=34merge_mcp_json() lines 467-498: Cog=6, Cyc=11, SLOC=32merge_codex_toml() lines 534-568: Cog=6, Cyc=11, SLOC=35print_hints() lines 1906-1933: Cog=8, Cyc=9, SLOC=28extract_tool_fields() lines 1634-1680: Cog=7, Cyc=6, SLOC=47audit_bundle_command() lines 665-694: Cog=6, Cyc=9, SLOC=30print_tool_info_entry() lines 1954-1976: Cog=5, Cyc=6, SLOC=23resolve_sandbox_policy() lines 280-304: Cog=4, Cyc=3, SLOC=25stage_paths_into_vault_trash() lines 464-487: Cog=4, Cyc=6, SLOC=24maybe_stage_configured_delete() lines 489-521: Cog=4, Cyc=7, SLOC=33on_cancelled() lines 1181-1244: Cog=4, Cyc=5, SLOC=64list_tools() lines 1246-1325: Cog=4, Cyc=4, SLOC=80dispatch_subcommand_tool() lines 1451-1542: Cog=4, Cyc=13, SLOC=92parse_llm_selection() lines 1168-1185: Cog=5, Cyc=5, SLOC=18submit_provider_picker() lines 251-275: Cog=4, Cyc=3, SLOC=25open_model_picker() lines 1054-1075: Cog=4, Cyc=5, SLOC=22parse_run_command() lines 1135-1166: Cog=4, Cyc=7, SLOC=32handle_providers_discovered() lines 1238-1257: Cog=4, Cyc=5, SLOC=20main() lines 1085-1194: Cog=8, Cyc=14, SLOC=110spawn_stderr_monitor() lines 832-861: Cog=5, Cyc=4, SLOC=30store_error_context() lines 886-915: Cog=5, Cyc=4, SLOC=30run_monitoring_loop() lines 1012-1050: Cog=5, Cyc=7, SLOC=39track_completion() lines 141-150: Cog=4, Cyc=3, SLOC=10start_bridge_tcp() lines 529-628: Cog=8, Cyc=14, SLOC=100encode_file_uri() lines 1079-1115: Cog=7, Cyc=7, SLOC=37maybe_install_sighup_handler() lines 394-424: Cog=6, Cyc=7, SLOC=31handle_sse_stream() lines 887-998: Cog=6, Cyc=15, SLOC=112build_cors_layer() lines 217-256: Cog=4, Cyc=5, SLOC=40config_relative_path() lines 153-167: Cog=5, Cyc=10, SLOC=15remove_managed_hook_entries() lines 727-754: Cog=5, Cyc=2, SLOC=28uninstall_copilot_hook() lines 872-897: Cog=5, Cyc=2, SLOC=26write_hook_document() lines 1075-1108: Cog=5, Cyc=11, SLOC=34any_managed_hooks_installed_in_env() lines 284-292: Cog=4, Cyc=5, SLOC=9handle_session_isolated_request_sse() lines 673-760: Cog=9, Cyc=13, SLOC=88forward_request_sse() lines 830-918: Cog=7, Cyc=9, SLOC=89handle_existing_session_request() lines 202-254: Cog=6, Cyc=9, SLOC=53handle_initialize_sse() lines 763-796: Cog=6, Cyc=7, SLOC=34forward_notification_sse() lines 799-826: Cog=4, Cyc=4, SLOC=28build_hotspot_section() lines 410-441: Cog=11, Cyc=8, SLOC=32write_package_simplicity() lines 195-218: Cog=10, Cyc=5, SLOC=24identify_culprit() lines 377-406: Cog=7, Cyc=9, SLOC=30language_group_label() lines 36-49: Cog=4, Cyc=6, SLOC=14from_files() lines 64-106: Cog=4, Cyc=9, SLOC=43handle_connection() lines 625-754: Cog=9, Cyc=15, SLOC=130ensure_daemon_running() lines 234-278: Cog=5, Cyc=7, SLOC=45daemon_subscribe_register_event_unregister_flow() lines 972-1088: Cog=5, Cyc=7, SLOC=117default_socket_path() lines 159-186: Cog=3, Cyc=4, SLOC=28run_daemon_at() lines 351-388: Cog=3, Cyc=6, SLOC=38handle_session_io() lines 1016-1166: Cog=8, Cyc=20, SLOC=151handle_sandbox_notification() lines 558-602: Cog=7, Cyc=11, SLOC=45dispatch_subprocess_line() lines 608-659: Cog=7, Cyc=10, SLOC=52create_session() lines 686-775: Cog=4, Cyc=5, SLOC=90resolve_sandbox_scopes() lines 783-825: Cog=4, Cyc=6, SLOC=43run_reporter_loop() lines 68-259: Cog=25, Cyc=26, SLOC=192result_summary_from() lines 274-295: Cog=6, Cyc=10, SLOC=22status_label() lines 263-272: Cog=1, Cyc=6, SLOC=10run_async_operation() lines 562-660: Cog=6, Cyc=10, SLOC=99drain_task_handle() lines 695-715: Cog=4, Cyc=7, SLOC=21handle_stream_line() lines 1148-1166: Cog=4, Cyc=5, SLOC=19push() lines 86-100: Cog=3, Cyc=3, SLOC=15send_final_result_progress() lines 770-784: Cog=3, Cyc=2, SLOC=15apply_external() lines 496-543: Cog=9, Cyc=11, SLOC=48from_external_issues() lines 160-201: Cog=8, Cyc=10, SLOC=42from_external() lines 419-484: Cog=8, Cyc=9, SLOC=66weighted_function_mi() lines 629-644: Cog=5, Cyc=5, SLOC=16resolve_extensions() lines 291-303: Cog=4, Cyc=4, SLOC=13start_config_watcher() lines 102-212: Cog=14, Cyc=20, SLOC=111configure_sandbox_from_roots() lines 338-422: Cog=7, Cyc=11, SLOC=85snapshot_json_files() lines 60-73: Cog=6, Cyc=6, SLOC=14update_tools() lines 77-99: Cog=5, Cyc=3, SLOC=23maybe_load_per_client_tools() lines 272-336: Cog=5, Cyc=11, SLOC=65start_deferred_sandbox_server() lines 127-166: Cog=6, Cyc=5, SLOC=40wait_for_bound_port() lines 90-110: Cog=5, Cyc=5, SLOC=21drain_sse_buffer() lines 431-452: Cog=4, Cyc=3, SLOC=22test_malformed_uri_parsing() lines 590-630: Cog=4, Cyc=5, SLOC=41poll_until_healthy() lines 112-124: Cog=3, Cyc=4, SLOC=13test_client_response_invalid_roots() lines 224-336: Cog=13, Cyc=12, SLOC=113run_task_vault_inheritance_and_staged_delete() lines 399-551: Cog=11, Cyc=12, SLOC=153process_sse_roots_handshake() lines 284-368: Cog=16, Cyc=15, SLOC=85send_tool_call_with_retry() lines 179-224: Cog=8, Cyc=9, SLOC=46send_mcp_request() lines 40-100: Cog=6, Cyc=11, SLOC=61first_sse_event_boundary() lines 162-176: Cog=4, Cyc=7, SLOC=15drain_sse_events() lines 241-251: Cog=3, Cyc=3, SLOC=11test_multiline_git_commit_message() lines 382-575: Cog=7, Cyc=6, SLOC=194test_multiline_git_commit_with_real_tool() lines 209-379: Cog=4, Cyc=6, SLOC=171Scores are calibrated for AI-assisted maintenance: decomposed, focused functions reduce the context an AI agent must hold to make safe changes.
The composite simplicity score is computed as:
Score = 0.4 × MI + 0.3 × Cognitive Density + 0.2 × Peak Cognitive + 0.1 × Length Score
| Component | Weight | What it measures |
|---|---|---|
| Maintainability Index (MI) | 40% | Function-weighted composite of Halstead volume, cyclomatic, and SLOC |
| Cognitive Density | 30% | Cognitive complexity normalised by SLOC |
| Peak Cognitive | 20% | Cognitive complexity of the single most complex function |
| Length Score | 10% | 100% at ≤300 SLOC; scales down linearly above that |
| Cyclomatic | — | Reported for context only; already embedded in MI |