File Complexity Overall
  • There are 267 files with units, with 74,970 lines of code.
    • 2 very complex files (McCabe index sum 251+; 4,063 lines of code)
    • 9 complex files (McCabe index sum 126-250; 12,192 lines of code)
    • 28 medium complex files (McCabe index sum 51-125; 16,420 lines of code)
    • 55 slightly complex files (McCabe index sum 26-50; 21,643 lines of code)
    • 173 simple files (McCabe index sum 1-25; 20,652 lines of code)
  • 1,678 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system5% | 16% | 21% | 28% | 27%
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
py5% | 16% | 21% | 28% | 27%
cjs0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
scripts52% | 0% | 30% | 2% | 14%
src2% | 17% | 21% | 30% | 28%
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
2321 42 574 25 202
_client.py
in src/openai
1742 197 262 15 9
_base_client.py
in src/openai
1822 103 217 12 17
responses.py
in src/openai/resources/responses
2836 92 197 7 18
responses.py
in src/openai/resources/beta/responses
3272 80 156 5 15
_session.py
in src/openai/lib/responses_websocket
493 35 151 31 20
realtime.py
in src/openai/resources/realtime
1109 85 143 13 15
live.py
in src/openai/resources/live
1075 86 142 13 15
_x509.py
in src/openai/auth
578 35 139 24 19
_accumulator.py
in src/openai/lib/responses_websocket
379 11 135 36 74
_models.py
in src/openai
628 30 126 20 40
_assistants.py
in src/openai/lib/streaming
593 47 125 21 55
forks.py
in src/openai/resources/live
962 67 121 13 15
sideband.py
in src/openai/resources/live
961 65 120 12 15
runs.py
in src/openai/resources/beta/threads/runs
1883 48 114 6 3
_transcript_grouping.py
in src/openai/lib/live
280 24 108 39 14
_response.py
in src/openai
472 45 98 21 37
projects.py
in src/openai/resources/admin/organization/projects
698 86 98 14 3
custom_code_report.py
in scripts/castiron
949 25 88 9 18
organization.py
in src/openai/resources/admin/organization
368 86 86 23 1
_utils.py
in src/openai/_utils
270 36 83 31 13
bedrock.py
in src/openai/providers
421 23 77 18 11
_legacy_response.py
in src/openai
322 34 75 23 36
sessions.py
in src/openai/resources/beta/agents/sessions
758 55 73 10 3
_completions.py
in src/openai/lib/streaming/chat
550 29 72 13 35
bedrock.py
in src/openai/lib
810 23 72 9 8
_result.py
in src/openai/lib/beta/agents
189 18 71 38 23
pagination.py
in src/openai
223 28 66 30 4
threads.py
in src/openai/resources/beta/threads
1065 35 65 6 3
azure.py
in src/openai/lib
710 26 65 9 10
_workload.py
in src/openai/auth
278 24 63 23 9
realtime.py
in src/openai/resources/beta/realtime
615 53 61 10 4
_streaming.py
in src/openai
348 29 58 17 14
_streams.py
in src/openai/lib/streaming/agents
286 18 58 20 12
custom_code_budget.py
in scripts/castiron
376 11 56 15 10
completions.py
in src/openai/resources/chat/completions
1284 29 55 4 3
__init__.py
in src/openai
378 34 54 14 12
_files.py
in src/openai/lib/beta/agents
237 15 54 23 16
_transcript_state.py
in src/openai/lib/live
134 10 51 38 21
_tools.py
in src/openai/lib/beta/agents
265 19 48 18 18
_responses.py
in src/openai/lib/streaming/responses
323 19 48 15 17
videos.py
in src/openai/resources
977 21 45 5 3
_transcript_grouper.py
in src/openai/lib/live
242 22 45 19 6
agents.py
in src/openai/resources/beta/agents
518 32 44 8 3
vector_stores.py
in src/openai/resources/vector_stores
557 28 44 8 3
_httpx2.py
in src/openai
100 20 42 42 4
beta.py
in src/openai/resources/beta
177 42 42 24 1
webhooks.py
in src/openai/resources/webhooks
788 26 42 5 3
jobs.py
in src/openai/resources/fine_tuning/jobs
539 23 41 8 3
usage.py
in src/openai/resources/admin/organization
1154 19 41 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...