File Complexity Overall
  • There are 195 files with units, with 55,347 lines of code.
    • 7 very complex files (McCabe index sum 251+; 14,978 lines of code)
    • 12 complex files (McCabe index sum 126-250; 9,002 lines of code)
    • 39 medium complex files (McCabe index sum 51-125; 15,891 lines of code)
    • 38 slightly complex files (McCabe index sum 26-50; 8,689 lines of code)
    • 99 simple files (McCabe index sum 1-25; 6,787 lines of code)
  • 7 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system27% | 16% | 28% | 15% | 12%
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
go27% | 16% | 28% | 15% | 12%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
ROOT30% | 15% | 23% | 20% | 10%
internal23% | 20% | 31% | 6% | 18%
shared81% | 0% | 0% | 18% | 0%
lib0% | 55% | 44% | 0% | 0%
tools0% | 0% | 94% | 0% | 5%
packages0% | 0% | 51% | 0% | 48%
option0% | 0% | 90% | 0% | 9%
bedrock0% | 0% | 80% | 0% | 19%
mcp0% | 0% | 100% | 0% | 0%
config0% | 0% | 40% | 0% | 59%
vertex0% | 0% | 0% | 100% | 0%
googlecloud0% | 0% | 0% | 0% | 100%
toolrunner0% | 0% | 0% | 0% | 100%
foundry0% | 0% | 0% | 0% | 100%
aws0% | 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
5427 792 1132 21 38
3238 444 705 22 17
constants.go
in shared/constant
1063 634 635 60 2
1850 224 358 19 5
1507 192 298 20 15
decode.go
in internal/encoding/json
958 30 276 29 51
encode.go
in internal/encoding/json
935 49 264 28 47
1289 151 242 19 6
1216 184 234 19 45
881 50 204 23 23
memories.go
in lib/environments
812 34 191 24 27
decoder.go
in internal/apijson
590 22 166 28 55
streaming.go
in lib/betafallback
653 26 160 25 16
requestconfig.go
in internal/requestconfig
607 32 154 25 28
720 100 152 21 38
scanner.go
in internal/encoding/json
437 43 146 33 12
551 41 144 26 17
652 100 133 20 7
594 54 126 21 33
576 77 122 21 4
filestore.go
in internal/filestore
440 25 119 27 12
649 76 119 18 5
559 75 116 21 4
betafallback.go
in lib/betafallback
389 14 113 29 37
621 85 110 18 17
631 78 110 17 5
494 46 104 21 27
480 58 99 21 5
454 58 94 21 5
skillarchive.go
in tools/agenttoolset
302 14 91 30 22
1122 89 91 8 2
union.go
in internal/apijson
286 11 90 31 30
stream.go
in internal/encoding/json
336 21 89 26 24
pagination.go
in packages/pagination
384 36 87 23 10
521 54 85 16 6
374 34 83 22 19
encoder.go
in internal/apiquery
346 11 81 23 20
worker.go
in lib/environments
436 12 81 19 31
encoder.go
in internal/apiform
393 14 77 20 24
470 49 76 16 5
fs.go
in tools/agenttoolset
310 16 75 24 17
poller.go
in lib/environments
335 20 71 21 17
encoder.go
in internal/apijson
313 14 70 22 21
search.go
in tools/agenttoolset
283 13 69 24 18
bash.go
in tools/agenttoolset
289 17 68 24 12
486 48 65 13 4
bedrock.go
in bedrock
271 10 63 23 24
mcp.go
in mcp
253 15 61 24 13
425 33 61 14 5
220 7 60 27 33
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...