File Complexity Overall
  • There are 281 files with units, with 68,773 lines of code.
    • 4 very complex files (McCabe index sum 251+; 6,750 lines of code)
    • 2 complex files (McCabe index sum 126-250; 936 lines of code)
    • 30 medium complex files (McCabe index sum 51-125; 13,100 lines of code)
    • 21 slightly complex files (McCabe index sum 26-50; 6,754 lines of code)
    • 224 simple files (McCabe index sum 1-25; 41,233 lines of code)
  • 187 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system9% | 1% | 19% | 9% | 59%
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
ts10% | 1% | 17% | 9% | 61%
py0% | 0% | 96% | 0% | 3%
cjs0% | 0% | 0% | 50% | 49%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
src10% | 1% | 16% | 9% | 61%
scripts0% | 0% | 56% | 8% | 35%
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
transform.ts
in src/lib
1590 47 487 31 91
2134 51 417 20 58
response-accumulator.ts
in src/internal/responses
1267 39 287 23 19
EventStream.ts
in src/lib
1759 49 285 16 26
utils.ts
in src/internal/qs
559 22 158 28 43
377 20 126 33 20
streaming.ts
in src/core
590 24 121 21 16
474 17 119 25 18
standard-schema.ts
in src/helpers
531 32 119 22 11
stringify.ts
in src/internal/qs
330 8 109 33 48
515 14 93 18 50
transformer.ts
in scripts/_vendor/tsc-multi/src
306 8 90 29 67
custom_code_report.py
in scripts/castiron
949 25 88 9 18
bedrock.ts
in src/internal
435 20 86 20 17
340 12 83 24 18
307 14 80 26 16
uploads.ts
in src/internal
524 18 80 15 17
ws-base.ts
in src/resources/live/sideband
536 11 78 15 27
ws-base.ts
in src/resources/live/forks
531 11 78 15 27
ws-base.ts
in src/resources/live
528 11 78 15 27
x509-workload-identity-auth.ts
in src/internal/auth
841 14 78 9 15
worker.ts
in scripts/_vendor/tsc-multi/src/worker
385 19 75 19 14
transcript-grouping.ts
in src/lib/live
357 18 74 21 13
x509-token-exchange.ts
in src/internal/auth
285 9 73 26 19
244 12 64 26 14
aws.ts
in src/providers/bedrock
260 12 63 24 13
ws-base.ts
in src/resources/beta/responses
582 14 63 11 30
ws-base.ts
in src/resources/responses
578 14 63 11 30
ws.ts
in src/realtime/translations
460 16 63 14 11
audio.ts
in src/helpers
259 7 62 24 34
custom_code_budget.py
in scripts/castiron
376 11 56 15 10
855 24 56 7 22
162 10 55 34 18
275 11 53 19 11
x509-transport-capability.ts
in src/internal/auth
159 12 52 33 10
ResponseInputItems.ts
in src/lib/responses
126 4 52 41 46
ws-adapter-node.ts
in src/internal
197 10 47 24 21
ws.ts
in src/internal
389 13 46 12 15
zod.ts
in src/helpers
328 22 45 14 7
string.ts
in src/_vendor/zod-to-json-schema/parsers
356 3 44 12 39
parser.ts
in src/_vendor/partial-json-parser
243 3 43 18 30
filesystem.ts
in src/helpers/beta/agents
173 9 43 25 14
EventEmitter.ts
in src/lib
176 3 41 23 29
parser.ts
in src/lib
333 16 41 12 8
transcript-grouper.ts
in src/lib/live
231 10 40 17 9
cache.cjs
in scripts/steady
176 6 39 22 14
websocket.ts
in src/beta/realtime
265 7 39 15 12
client.ts
in src
2409 3 37 2 18
canonical-output-text.ts
in src/internal/responses
164 8 36 22 8
websocket.ts
in src/realtime
257 6 36 14 12
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...