File Complexity Overall
  • There are 1,825 files with units, with 217,384 lines of code.
    • 0 very complex files (McCabe index sum 251+; 0 lines of code)
    • 6 complex files (McCabe index sum 126-250; 15,931 lines of code)
    • 20 medium complex files (McCabe index sum 51-125; 13,581 lines of code)
    • 55 slightly complex files (McCabe index sum 26-50; 42,090 lines of code)
    • 1,744 simple files (McCabe index sum 1-25; 145,782 lines of code)
  • 1,396 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 7% | 6% | 19% | 67%
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
rbi0% | 7% | 3% | 19% | 68%
rb0% | 5% | 23% | 16% | 55%
py0% | 0% | 95% | 0% | 4%
cjs0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
rbi0% | 7% | 3% | 19% | 68%
lib0% | 5% | 22% | 16% | 55%
scripts0% | 0% | 73% | 0% | 26%
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
chat_completion_stream.rb
in lib/openai/helpers/streaming
661 47 191 29 32
audit_log_list_response.rbi
in rbi/openai/models/admin/organization
4826 172 172 4 1
beta_response_input_item.rbi
in rbi/openai/models/beta
3635 171 171 5 1
bedrock.rb
in lib/openai/providers
540 26 151 28 53
beta_responses_server_event.rbi
in rbi/openai/models/beta
3256 128 128 4 1
responses_server_event.rbi
in rbi/openai/models/responses
3013 126 126 4 1
session.rb
in lib/openai/helpers/responses_websocket
454 23 113 25 22
response_input_item.rbi
in rbi/openai/models/responses
2349 105 105 4 1
transcript_grouping.rb
in lib/openai/helpers/live
253 23 104 41 14
custom_code_report.py
in scripts/castiron
949 25 88 9 18
util.rb
in lib/openai/internal
791 33 85 11 15
beta_response_output_item.rbi
in rbi/openai/models/beta
1890 84 84 4 1
beta_response_item.rbi
in rbi/openai/models/beta
1806 84 84 5 1
incremental.rb
in lib/openai/helpers/responses_websocket
191 8 84 44 62
client.rb
in lib/openai
583 3 77 13 55
examples-e2e.rb
in scripts
351 25 69 20 17
base_client.rb
in lib/openai/internal/transport
688 10 61 9 29
transcript_grouper.rb
in lib/openai/helpers/live
201 13 60 30 13
result.rb
in lib/openai/helpers/beta/agents
131 12 59 45 31
response_stream.rb
in lib/openai/helpers/streaming
226 14 58 26 16
typed_output.rb
in lib/openai/helpers/beta/agents
153 9 57 37 16
custom_code_budget.py
in scripts/castiron
376 11 56 15 10
logging.rb
in lib/openai/internal
420 24 56 13 6
files.rb
in lib/openai/helpers/beta/agents
197 12 55 28 16
beta_response.rbi
in rbi/openai/models/beta
1367 53 53 4 1
response_parser.rb
in lib/openai/helpers/structured_output
205 11 52 25 9
assistant_stream_event.rbi
in rbi/openai/models/beta
838 49 49 6 1
1475 46 46 3 1
response.rbi
in rbi/openai/models/responses
1101 46 46 4 1
session_stream.rb
in lib/openai/helpers/agents
154 8 45 29 13
response_tool_search_output_item_param.rbi
in rbi/openai/models/responses
1452 44 44 3 1
events.rbi
in rbi/openai/helpers/streaming
175 44 44 25 1
base_model.rb
in lib/openai/internal/type
310 15 44 14 14
beta_responses_client_event.rbi
in rbi/openai/models/beta
1668 42 42 3 1
response_create_params.rbi
in rbi/openai/models/beta
1177 42 42 4 1
local_audio.rb
in lib/openai/helpers
136 5 42 31 13
run_create_response.rbi
in rbi/openai/models/evals
1065 41 41 4 1
run_retrieve_response.rbi
in rbi/openai/models/evals
1069 41 41 4 1
run_list_response.rbi
in rbi/openai/models/evals
1061 41 41 4 1
run_cancel_response.rbi
in rbi/openai/models/evals
1065 41 41 4 1
realtime_session_create_response.rbi
in rbi/openai/models/realtime
1228 41 41 3 1
azure.rb
in lib/openai/providers
184 9 41 22 18
process.rb
in lib/openai/helpers/local_audio
133 8 41 31 8
beta_tool.rbi
in rbi/openai/models/beta
893 40 40 4 1
tool.rbi
in rbi/openai/models/responses
895 40 40 4 1
thread_create_and_run_params.rbi
in rbi/openai/models/beta
881 38 38 4 1
chat_completion_chunk.rbi
in rbi/openai/models/chat
887 38 38 4 1
recovery.rb
in lib/openai/helpers/realtime
399 10 38 10 8
run_create_params.rbi
in rbi/openai/models/evals
1048 36 36 3 1
response_output_item.rbi
in rbi/openai/models/responses
928 36 36 4 1
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...