File Complexity Overall
  • There are 223 files with units, with 49,267 lines of code.
    • 7 very complex files (McCabe index sum 251+; 11,436 lines of code)
    • 13 complex files (McCabe index sum 126-250; 9,470 lines of code)
    • 45 medium complex files (McCabe index sum 51-125; 14,931 lines of code)
    • 40 slightly complex files (McCabe index sum 26-50; 6,706 lines of code)
    • 118 simple files (McCabe index sum 1-25; 6,724 lines of code)
  • 33 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system23% | 19% | 30% | 13% | 13%
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
go20% | 21% | 30% | 12% | 14%
cjs100% | 0% | 0% | 0% | 0%
py0% | 0% | 46% | 36% | 17%
ts0% | 0% | 42% | 39% | 18%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
pkg24% | 22% | 27% | 12% | 13%
plugins78% | 0% | 0% | 9% | 12%
cmd0% | 18% | 50% | 13% | 17%
wrappers0% | 0% | 100% | 0% | 0%
scripts0% | 0% | 44% | 55% | 0%
ROOT0% | 0% | 100% | 0% | 0%
adminui0% | 0% | 0% | 68% | 31%
testsupport0% | 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
server.cjs
in plugins/tunnel-mcp/mcp
2290 132 757 33 32
config.go
in pkg/runtimeconfig
2401 91 614 26 54
manager.go
in pkg/codexplugin
1902 70 457 24 36
localproxy.go
in pkg/localproxy
1509 66 364 24 22
session.go
in pkg/codexplugin/session
1363 85 322 24 28
786 51 294 37 38
server.go
in pkg/runtimeharpoon
1185 55 256 22 27
processor.go
in pkg/dispatcher/internal
1110 31 243 22 41
template.go
in pkg/runtimeharpoon
637 23 242 38 52
log_export.go
in pkg/adminui
1024 58 235 23 16
tunnel_service_client.go
in pkg/controlplane/internal
983 43 230 23 35
bridge.go
in pkg/codexappserver
1318 39 229 17 36
registry.go
in pkg/runtimeharpoon
633 29 183 29 38
protocol_observation.go
in pkg/mcpclient
551 26 170 31 20
file_config.go
in pkg/runtimeconfig
626 20 161 26 23
codexplugin.go
in pkg/codexplugin
630 37 158 25 11
stdio_preflight.go
in cmd/client
430 25 148 34 19
669 30 144 22 30
template_body.go
in pkg/runtimeharpoon
278 7 132 47 36
fxmodule.go
in pkg/mcpclient
581 21 130 22 17
host_registration.go
in pkg/runtimeharpoon
486 18 113 23 26
header_rules_config.go
in pkg/runtimeconfig
366 17 111 30 11
supervisor.go
in pkg/cloudflared/runtime
459 21 106 23 14
health.go
in pkg/runtimehealth
396 16 105 27 20
checker.go
in pkg/proxyhealth
497 27 103 21 14
hostbundle.go
in pkg/oauth
405 23 103 25 10
inmemory_transport.go
in pkg/runtimeharpoon
360 25 103 29 10
template_server.go
in pkg/runtimeharpoon
411 12 98 24 20
doctor_command.go
in cmd/client
634 17 97 15 13
codex_command.go
in cmd/client
610 20 96 16 21
header_rules.go
in pkg/runtimeharpoon
257 10 96 37 34
376 14 94 25 34
tunnels_command.go
in cmd/client/admin
480 20 93 19 12
state.go
in pkg/codexplugin/state
390 28 92 24 12
codex.go
in pkg/adminui
449 22 90 20 11
health_command.go
in cmd/client
404 14 89 22 9
health.go
in pkg/controlplane
320 31 80 25 8
mcp_tunnel_client_proxy.ts
in wrappers/mcp-tunnel-client-proxy/typescript
336 21 72 21 8
216 12 72 33 23
log_buffer.go
in pkg/adminui
337 15 72 21 11
route.go
in pkg/proxy
275 12 70 25 14
tunnel_failure.go
in pkg/dispatcher/internal
267 9 70 26 24
server.go
in pkg/harpoon
285 17 69 24 14
stdio_command.go
in pkg/mcpclient
322 17 69 21 9
fxmodule.go
in pkg/controlplane/fx
374 14 69 18 11
profiles_command.go
in cmd/client
342 12 66 19 13
catalog_digest.go
in pkg/runtimeharpoon
300 16 66 22 10
components.go
in pkg/runtimehealth
197 6 65 33 28
poller.go
in pkg/controlplane/internal
320 10 65 20 30
resource_meta.go
in pkg/oauth
316 12 64 20 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...