File Complexity Overall
  • There are 283 files with units, with 110,698 lines of code.
    • 2 very complex files (McCabe index sum 251+; 5,905 lines of code)
    • 16 complex files (McCabe index sum 126-250; 24,407 lines of code)
    • 57 medium complex files (McCabe index sum 51-125; 40,668 lines of code)
    • 42 slightly complex files (McCabe index sum 26-50; 19,821 lines of code)
    • 166 simple files (McCabe index sum 1-25; 19,897 lines of code)
  • 69 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system5% | 22% | 36% | 17% | 17%
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
py5% | 22% | 36% | 17% | 17%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
src4% | 23% | 35% | 18% | 17%
integration_tests41% | 0% | 7% | 10% | 40%
.github0% | 31% | 47% | 10% | 11%
.agents0% | 0% | 94% | 5% | 0%
Most Complex Files (Top 50)

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
run_state.py
in src/agents
4676 127 446 10 32
_contract_surface.py
in integration_tests
1229 70 319 26 32
tool.py
in src/agents
1964 107 250 13 18
_mount_security.py
in src/agents/sandbox
2028 73 245 12 21
codex_tool.py
in src/agents/extensions/experimental/codex
1215 49 219 18 47
processors.py
in src/agents/tracing
682 41 195 29 19
openai_responses.py
in src/agents/models
2002 70 194 10 18
run_context.py
in src/agents
1513 56 185 12 22
tool_execution.py
in src/agents/run_internal
2414 57 164 7 20
items.py
in src/agents
696 43 160 23 13
result.py
in src/agents
883 40 152 17 23
items.py
in src/agents/run_internal
928 43 145 16 14
turn_resolution.py
in src/agents/run_internal
3602 44 144 4 13
server.py
in src/agents/mcp
1947 56 142 7 11
any_llm_model.py
in src/agents/extensions/models
1374 33 138 10 13
advanced_sqlite_session.py
in src/agents/extensions/memory
1147 46 128 11 16
477 23 127 27 31
sandbox.py
in src/agents/extensions/sandbox/vercel
1535 53 127 8 18
_tool_identity.py
in src/agents
513 40 122 24 10
runtime_session_manager.py
in src/agents/sandbox
995 44 118 12 16
oai_conversation.py
in src/agents/run_internal
551 20 117 21 25
openai_realtime.py
in src/agents/realtime
1870 47 116 6 10
docker.py
in src/agents/sandbox/sandboxes
1881 42 114 6 18
review_state.py
in .agents/skills/implementation-final-review/scripts
637 31 113 18 13
traces.py
in src/agents/tracing
346 44 112 32 19
sandbox.py
in src/agents/extensions/sandbox/cloudflare
1541 28 106 7 22
workspace_paths.py
in src/agents/sandbox
411 42 106 26 8
release_automation.py
in .github/scripts
360 16 105 29 18
skills.py
in src/agents/sandbox/capabilities
844 26 100 12 21
manifest.py
in src/agents/sandbox
507 31 100 20 10
history.py
in src/agents/handoffs
519 33 98 19 10
review_protocol.py
in .agents/skills/implementation-final-review/scripts
1277 28 93 7 12
usage.py
in src/agents
337 27 90 27 18
sandbox.py
in src/agents/extensions/sandbox/runloop
1452 44 89 6 10
apply_diff.py
in src/agents
304 17 89 29 26
prepare.py
in .agents/skills/release-candidate-prep/scripts
511 27 86 17 10
424 17 86 20 26
provider.py
in src/agents/tracing
346 45 85 25 10
tool_output_trimmer.py
in src/agents/extensions
360 12 85 24 21
session_persistence.py
in src/agents/run_internal
1541 34 84 5 8
_docker_removal_worker.py
in src/agents/sandbox/sandboxes
286 13 82 29 23
inventory_logging.py
in .agents/skills/sensitive-logging-audit/scripts
314 18 78 25 9
chatcmpl_stream_handler.py
in src/agents/models
1093 24 78 7 15
sandbox.py
in src/agents/extensions/sandbox/blaxel
1097 25 76 7 9
sandbox.py
in src/agents/extensions/sandbox/e2b
1555 36 76 5 10
model.py
in src/agents/testing
1115 34 76 7 23
sandbox.py
in src/agents/extensions/sandbox/modal
1564 31 75 5 9
tar_utils.py
in src/agents/sandbox/util
423 22 74 17 10
retry.py
in src/agents
348 26 73 21 14
exceptions.py
in src/agents
417 31 71 17 23
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...