File Complexity Overall
  • There are 174 files with units, with 14,905 lines of code.
    • 0 very complex files (McCabe index sum 251+; 0 lines of code)
    • 2 complex files (McCabe index sum 126-250; 1,287 lines of code)
    • 9 medium complex files (McCabe index sum 51-125; 3,264 lines of code)
    • 21 slightly complex files (McCabe index sum 26-50; 3,966 lines of code)
    • 142 simple files (McCabe index sum 1-25; 6,388 lines of code)
  • 17 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 8% | 21% | 26% | 42%
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
go0% | 8% | 21% | 26% | 42%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
internal0% | 10% | 14% | 30% | 44%
pkg0% | 0% | 50% | 0% | 49%
rpc0% | 0% | 74% | 25% | 0%
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
worker.go
in internal/worker
788 25 193 24 37
api_vms.go
in internal/controller
499 13 133 27 32
551 72 115 21 3
scheduler.go
in internal/controller/scheduler
433 10 90 21 42
controller.go
in internal/controller
404 11 70 17 20
tart.go
in internal/worker/vmmanager/tart
364 13 64 18 20
api_vms_exec.go
in internal/controller
283 8 63 22 15
v1.go
in pkg/resource/v1
313 22 59 19 14
sshexec.go
in internal/controller/sshexec
294 15 58 20 10
client.go
in pkg/client
338 22 53 16 10
vms.go
in pkg/client
284 19 51 18 8
api_vms_portforward.go
in internal/controller
245 4 47 19 17
rpcv2.go
in internal/worker
182 8 45 25 11
base.go
in internal/worker/vmmanager/base
264 16 45 17 15
run.go
in internal/command/controller
238 3 40 17 31
vetu.go
in internal/worker/vmmanager/vetu
246 14 39 16 11
conn.go
in internal/udpconn
133 12 37 28 8
sshserver.go
in internal/controller/sshserver
230 6 37 16 14
create.go
in internal/command/context
238 6 36 15 15
api.go
in internal/controller
284 10 33 12 8
dev.go
in internal/command/dev
217 5 33 15 18
run.go
in internal/command/worker
242 4 32 13 22
api_service_accounts.go
in internal/controller
131 5 31 24 12
handle.go
in internal/config
131 7 30 23 8
listener.go
in internal/udpconn
139 9 29 21 5
vm.go
in internal/command/ssh
158 3 29 18 21
193 18 29 15 4
exec_ssh_clients.go
in internal/controller
157 10 28 18 8
badger_watch.go
in internal/controller/store/badger
129 1 28 22 28
api_workers.go
in internal/controller
128 5 28 22 13
endpoint.go
in internal/worker/endpoint
156 8 27 17 7
init.go
in internal/command/controller
125 4 26 21 10
simplename.go
in internal/simplename
63 3 25 40 12
rpc.go
in internal/worker
172 3 25 15 13
badger_events.go
in internal/controller/store/badger
124 5 23 19 13
synthetic.go
in internal/worker/vmmanager/synthetic
162 14 22 14 5
softnet_control.go
in internal/worker/vmmanager/tart
128 8 21 16 6
startup_script.go
in internal/worker/vmmanager/base
126 4 21 17 13
set.go
in internal/worker/hostprocess
119 9 21 18 7
bootstraptoken.go
in internal/bootstraptoken
122 6 20 16 9
resources.go
in pkg/resource/v1
80 10 20 25 3
datadir.go
in internal/controller
92 10 19 21 4
api_rpc_watch.go
in internal/controller
94 1 18 19 18
rpc.go
in internal/controller
86 3 17 20 7
vm_condition.go
in pkg/resource/v1
79 6 17 22 4
proxy.go
in internal/proxy
81 2 16 20 9
vm.go
in internal/command/create
196 2 16 8 15
option.go
in internal/controller
85 15 15 18 1
worker.go
in internal/command/vnc
83 2 15 18 14
cmd.go
in internal/worker/vmmanager/base
83 4 15 18 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...