File Complexity Overall
  • There are 172 files with units, with 43,233 lines of code.
    • 1 very complex files (McCabe index sum 251+; 1,181 lines of code)
    • 4 complex files (McCabe index sum 126-250; 2,555 lines of code)
    • 24 medium complex files (McCabe index sum 51-125; 6,823 lines of code)
    • 61 slightly complex files (McCabe index sum 26-50; 21,010 lines of code)
    • 82 simple files (McCabe index sum 1-25; 11,664 lines of code)
  • 28 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system2% | 5% | 15% | 48% | 26%
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
go2% | 5% | 15% | 48% | 26%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
pkg3% | 3% | 3% | 58% | 30%
internal0% | 12% | 48% | 23% | 16%
cmd0% | 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
cmd_auth.go
in pkg/cmd
1181 33 287 24 101
requestflag.go
in internal/requestflag
782 51 198 25 26
flagoptions.go
in pkg/cmd
547 15 159 29 56
explorer.go
in internal/jsonview
670 48 148 22 13
cmdutil.go
in pkg/cmd
556 21 144 26 19
load.go
in internal/declarative/conformance
396 15 115 29 21
fold.go
in internal/sessions/timeline
342 27 111 32 27
apply.go
in pkg/cmd
407 17 110 27 33
diff.go
in internal/declarative/core
341 19 109 32 18
transcript.go
in internal/sessions/tui
277 14 94 34 20
api.go
in internal/declarative/claude
302 17 80 26 8
autocomplete.go
in internal/autocomplete
291 11 77 26 20
run.go
in internal/declarative/conformance
279 15 76 27 18
tools.go
in internal/sessions/timeline
237 16 75 32 26
plan.go
in internal/declarative/core
325 16 71 22 19
render.go
in internal/declarative/render
274 20 70 26 11
detail.go
in internal/declarative/render
231 17 70 30 11
match.go
in internal/declarative/conformance
195 9 65 33 18
words.go
in internal/declarative/render
201 9 63 31 15
model.go
in internal/sessions/tui
283 11 59 21 13
loader.go
in internal/declarative/core
223 16 59 26 10
input.go
in internal/sessions/tui
225 16 58 26 9
follow.go
in internal/sessions/live
195 9 58 30 14
server.go
in internal/sessions/web
231 13 56 24 14
innerflag.go
in internal/requestflag
220 22 55 25 13
threads.go
in internal/sessions/live
269 18 54 20 8
654 8 54 8 9
apply.go
in internal/declarative/core
229 14 53 23 8
lock.go
in internal/declarative/core
196 15 52 27 9
fetch.go
in internal/declarative/core
214 10 49 23 13
skill.go
in internal/declarative/claude
212 9 49 23 17
resolve.go
in internal/declarative/core
198 10 48 24 8
943 8 48 5 7
705 7 46 7 9
schema.go
in internal/declarative/claude
135 10 44 33 24
cmd_profile.go
in pkg/cmd
186 6 44 24 19
run.go
in internal/declarative/acctest
221 14 42 19 16
encoder.go
in internal/apiquery
143 5 41 29 14
encoder.go
in internal/apiform
182 5 41 23 20
hub.go
in internal/sessions/web
189 17 39 21 10
registry.go
in internal/declarative/core
108 12 37 34 9
messagebatch.go
in pkg/cmd
434 6 37 9 8
464 6 37 8 8
sanitize.go
in internal/sessions/timeline
63 3 36 57 14
include.go
in internal/declarative/core
132 5 36 27 10
470 6 36 8 7
betavault.go
in pkg/cmd
457 6 36 8 7
477 6 36 8 7
519 6 36 7 7
460 6 36 8 7
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...