File Complexity Overall
  • There are 276 files with units, with 126,935 lines of code.
    • 16 very complex files (McCabe index sum 251+; 41,257 lines of code)
    • 28 complex files (McCabe index sum 126-250; 31,701 lines of code)
    • 45 medium complex files (McCabe index sum 51-125; 25,689 lines of code)
    • 45 slightly complex files (McCabe index sum 26-50; 14,113 lines of code)
    • 142 simple files (McCabe index sum 1-25; 14,175 lines of code)
  • 110 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system32% | 24% | 20% | 11% | 11%
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
ts33% | 25% | 18% | 11% | 11%
py0% | 0% | 78% | 10% | 10%
js0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
packages33% | 25% | 19% | 10% | 11%
.agents0% | 0% | 71% | 18% | 9%
helpers0% | 0% | 0% | 0% | 100%
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
runState.ts
in packages/agents-core/src
6776 154 1048 15 57
docker.ts
in packages/agents-core/src/sandbox/sandboxes
5021 269 774 15 18
toolExecution.ts
in packages/agents-core/src/runner
2932 74 489 17 67
sandbox.ts
in packages/agents-extensions/src/sandbox/runloop
2604 197 464 18 13
blockedOutputPersistence.ts
in packages/agents-core/src/runner
1926 58 462 24 39
mountSecurity.ts
in packages/agents-core/src/sandbox
2130 97 445 21 28
sandbox.ts
in packages/agents-extensions/src/sandbox/modal
2598 169 388 15 16
sandbox.ts
in packages/agents-extensions/src/sandbox/vercel
2431 171 378 16 13
openaiResponsesConverter.ts
in packages/agents-openai/src
1803 32 376 21 69
sessionPersistence.ts
in packages/agents-core/src/runner
2483 94 351 14 29
openaiResponsesModel.ts
in packages/agents-openai/src
2510 81 329 13 29
index.ts
in packages/agents-extensions/src/experimental/codex
1611 85 311 19 18
strictToolSchema.ts
in packages/agents-core/src/utils
1236 32 296 24 36
sandbox.ts
in packages/agents-extensions/src/sandbox/blaxel
1676 127 295 18 10
sandbox.ts
in packages/agents-extensions/src/sandbox/cloudflare
1812 118 288 16 23
node.ts
in packages/agents-core/src/shims/mcp-server
1708 87 272 16 18
turnResolution.ts
in packages/agents-core/src/runner
1801 37 247 14 53
run.ts
in packages/agents-core/src
3410 61 241 7 119
inContainerMounts.ts
in packages/agents-extensions/src/sandbox/shared
1408 79 239 17 15
index.ts
in packages/agents-extensions/src/ai-sdk
1494 45 239 16 26
localWorkspace.ts
in packages/agents-core/src/sandbox/sandboxes/shared
1259 91 236 19 9
sandbox.ts
in packages/agents-extensions/src/sandbox/daytona
1491 112 229 15 13
unixLocal.ts
in packages/agents-core/src/sandbox/sandboxes
1610 98 229 14 13
modelRetry.ts
in packages/agents-core/src/runner
1352 52 219 16 23
zodJsonSchemaCompat.ts
in packages/agents-core/src/utils
776 31 218 28 31
sandbox.ts
in packages/agents-extensions/src/sandbox/e2b
1248 83 216 17 17
manager.ts
in packages/agents-core/src/sandbox/runtime
1974 65 211 11 23
tool.ts
in packages/agents-core/src
2040 50 205 10 31
mcp.ts
in packages/agents-core/src
1450 53 198 14 20
messageConversion.ts
in packages/agents-extensions/src/ai-sdk
784 36 190 24 26
localSnapshots.ts
in packages/agents-core/src/sandbox/sandboxes/shared
834 58 165 20 11
toolSearch.ts
in packages/agents-core/src/runner
808 33 164 20 28
manifest.ts
in packages/agents-core/src/sandbox
1017 48 157 15 15
archive.ts
in packages/agents-extensions/src/sandbox/shared
767 44 156 20 16
items.ts
in packages/agents-core/src/runner
607 30 152 25 15
memorySession.ts
in packages/agents-core/src/memory
399 20 142 36 31
skills.ts
in packages/agents-core/src/sandbox/capabilities
689 31 142 21 22
session.ts
in packages/agents-extensions/src/sandbox/shared
541 35 139 26 14
mcpServers.ts
in packages/agents-core/src
695 46 137 20 12
toolOutputNormalization.ts
in packages/agents-core/src/runner
340 9 133 39 40
toolIdentity.ts
in packages/agents-core/src
478 33 133 28 19
scriptedModel.ts
in packages/agents-core/src/testing
679 44 132 19 17
sessionBase.ts
in packages/agents-extensions/src/sandbox/shared
887 89 130 15 11
mounts.ts
in packages/agents-extensions/src/sandbox/blaxel
863 45 129 15 17
agentToolInput.ts
in packages/agents-core/src
467 18 118 25 17
agent.ts
in packages/agents-core/src
903 16 116 13 52
storage.ts
in packages/agents-core/src/sandbox/memory
652 33 114 17 10
review_state.py
in .agents/skills/implementation-final-review/scripts
656 31 113 17 13
openaiRealtimeBase.ts
in packages/agents-realtime/src
924 21 112 12 47
localSources.ts
in packages/agents-extensions/src/sandbox/shared
676 41 107 16 8
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...