File Complexity Overall
  • There are 30 files with units, with 7,974 lines of code.
    • 0 very complex files (McCabe index sum 251+; 0 lines of code)
    • 3 complex files (McCabe index sum 126-250; 2,144 lines of code)
    • 4 medium complex files (McCabe index sum 51-125; 2,055 lines of code)
    • 5 slightly complex files (McCabe index sum 26-50; 2,084 lines of code)
    • 18 simple files (McCabe index sum 1-25; 1,691 lines of code)
  • 7 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 26% | 25% | 26% | 21%
Legend:
251+
126-250
51-125
26-50
1-25


explore: grouped by folders | grouped by complexity
File Complexity per Extension
251+
126-250
51-125
26-50
1-25
py0% | 26% | 25% | 26% | 21%
js0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
src0% | 27% | 23% | 27% | 21%
.github0% | 93% | 0% | 0% | 6%
scripts0% | 0% | 53% | 21% | 24%
Most Complex Files (Top 30)

The McCabe index of a file grows with its size: per 100 lines tells a large but plain file from a dense one, and most complex unit whether the complexity sits in one unit or is spread over many.

File# lines# unitsMcCabe index
(sum)
per 100
lines
most complex
unit
sessions.py
in src/claude_agent_sdk/_internal
1113 48 189 17 27
subprocess_cli.py
in src/claude_agent_sdk/_internal/transport
731 21 175 24 72
check_workflow_hardening.py
in .github/scripts
300 14 134 45 32
build_wheel.py
in scripts
489 21 99 20 11
query.py
in src/claude_agent_sdk/_internal
678 20 61 9 8
session_resume.py
in src/claude_agent_sdk/_internal
380 10 58 15 14
__init__.py
in src/claude_agent_sdk
508 11 53 10 21
session_mutations.py
in src/claude_agent_sdk/_internal
508 15 39 8 11
download_cli.py
in scripts
200 14 37 19 6
types.py
in src/claude_agent_sdk
894 7 32 4 12
session_summary.py
in src/claude_agent_sdk/_internal
142 5 30 21 16
message_parser.py
in src/claude_agent_sdk/_internal
340 2 29 9 26
_task_compat.py
in src/claude_agent_sdk/_internal
95 13 21 22 4
session_store.py
in src/claude_agent_sdk/_internal
119 7 21 18 10
38 3 16 42 10
sdk_mcp_bridge.py
in src/claude_agent_sdk/_internal
233 7 13 6 3
102 3 12 12 7
_errors.py
in src/claude_agent_sdk
59 6 11 19 6
24 2 9 38 6
session_store_validation.py
in src/claude_agent_sdk/_internal
27 2 8 30 6
session_import.py
in src/claude_agent_sdk/_internal
79 1 6 8 6
34 1 5 15 5
_mcp_compat.py
in src/claude_agent_sdk/_internal
66 4 5 8 2
transcript_mirror_batcher.py
in src/claude_agent_sdk/_internal
132 1 3 2 3
refresh-identity-token.js
in .github/actions/setup-claude-auth
20 1 2 10 2
__init__.py
in src/claude_agent_sdk/_internal/transport
23 2 2 9 1
session_store_conformance.py
in src/claude_agent_sdk/testing
221 2 2 1 1
31 1 1 3 1
client.py
in src/claude_agent_sdk/_internal
149 1 1 1 1
client.py
in src/claude_agent_sdk
239 1 1 0 1
About This Analysis
  • File complexity is the sum of the McCabe indexes (conditional complexity) of the units (methods, functions...) in a file.
  • Files are classified in five categories based on that sum: 1-25 (simple files), 26-50 (slightly complex files), 51-125 (medium complex files), 126-250 (complex files), 251+ (very complex files). The default bands are five times the unit complexity bands, as a file is a group of units.
  • Only main code files with units are classified. Files without units (languages without unit analysis, or files without functions) have no complexity to measure and are left out rather than counted as simple.
  • A very complex file holds many decisions, which often means it has too many responsibilities: a candidate to split, and a place where changes need more testing.
Learn more...