File Complexity Overall
  • There are 188 files with units, with 52,629 lines of code.
    • 1 very complex files (McCabe index sum 251+; 1,899 lines of code)
    • 6 complex files (McCabe index sum 126-250; 4,343 lines of code)
    • 14 medium complex files (McCabe index sum 51-125; 6,270 lines of code)
    • 55 slightly complex files (McCabe index sum 26-50; 25,247 lines of code)
    • 112 simple files (McCabe index sum 1-25; 14,870 lines of code)
  • 1,675 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system3% | 8% | 11% | 47% | 28%
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
py3% | 8% | 11% | 47% | 28%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
src3% | 8% | 11% | 48% | 27%
scripts0% | 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
_base_client.py
in src/anthropic
1899 109 252 13 13
_fallbacks.py
in src/anthropic/lib/middleware
1076 66 249 23 38
_client.py
in src/anthropic
782 76 151 19 12
agent_toolset.py
in src/anthropic/lib/tools
546 23 140 26 20
_beta_runner.py
in src/anthropic/lib/tools
720 47 139 19 12
_providers.py
in src/anthropic/lib/credentials
580 33 129 22 16
_models.py
in src/anthropic
639 34 129 20 38
_streaming.py
in src/anthropic
396 27 107 27 57
_beta_builtin_memory_tool.py
in src/anthropic/lib/tools
627 31 103 16 19
_response.py
in src/anthropic
497 47 101 20 38
organization.py
in src/anthropic/resources/beta/organization
478 99 101 21 3
beta.py
in src/anthropic/resources/beta
427 100 100 23 1
_utils.py
in src/anthropic/_utils
273 38 89 33 13
analytics.py
in src/anthropic/resources/beta/organization/analytics
316 74 74 23 1
_file_store.py
in src/anthropic/lib/tools
283 23 72 25 9
messages.py
in src/anthropic/resources/beta/messages
1670 34 70 4 3
_beta_functions.py
in src/anthropic/lib/tools
433 26 67 15 9
organization.py
in src/anthropic/resources/organization
322 63 65 20 3
_skills.py
in src/anthropic/lib/tools
163 10 55 34 21
_cache.py
in src/anthropic/lib/credentials
197 11 53 27 12
pagination.py
in src/anthropic
188 24 52 28 4
sessions.py
in src/anthropic/resources/beta/sessions
729 33 47 6 3
_files.py
in src/anthropic
116 12 47 41 17
workspaces.py
in src/anthropic/resources/organization/workspaces
451 32 44 10 3
plugins.py
in src/anthropic/resources/beta/organization/plugins
599 32 44 7 3
workspaces.py
in src/anthropic/resources/beta/organization/workspaces
462 32 44 10 3
messages.py
in src/anthropic/resources/messages
1043 24 44 4 3
_workload.py
in src/anthropic/lib/credentials
258 15 44 17 16
_client.py
in src/anthropic/lib/bedrock
358 13 42 12 10
memory_stores.py
in src/anthropic/resources/beta/memory_stores
637 27 41 6 3
_client.py
in src/anthropic/lib/google_cloud
456 20 40 9 5
_constants.py
in src/anthropic/lib/credentials
120 13 40 33 8
work.py
in src/anthropic/resources/beta/environments
913 21 39 4 3
foundry.py
in src/anthropic/lib
393 27 38 10 6
spend_limits.py
in src/anthropic/resources/beta/organization/spend_limits
354 25 35 10 3
tunnels.py
in src/anthropic/resources/beta/tunnels
578 21 35 6 3
environments.py
in src/anthropic/resources/beta/environments
620 21 35 6 3
vaults.py
in src/anthropic/resources/beta/vaults
594 21 35 6 3
deployments.py
in src/anthropic/resources/beta
825 17 35 4 3
_messages.py
in src/anthropic/lib/streaming
390 26 35 9 4
_beta_messages.py
in src/anthropic/lib/streaming
429 26 35 8 4
_client.py
in src/anthropic/lib/vertex
342 13 34 10 11
_compat.py
in src/anthropic
148 23 34 23 3
service_accounts.py
in src/anthropic/resources/organization/service_accounts
386 20 32 8 3
rules.py
in src/anthropic/resources/organization/federation/rules
439 20 32 7 3
service_accounts.py
in src/anthropic/resources/beta/organization/service_accounts
443 20 32 7 3
rbac_groups.py
in src/anthropic/resources/beta/organization/rbac_groups
350 20 32 9 3
rules.py
in src/anthropic/resources/beta/organization/federation/rules
504 20 32 6 3
agents.py
in src/anthropic/resources/beta/agents
592 20 32 5 3
credentials.py
in src/anthropic/resources/beta/vaults
742 16 32 4 3
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...