File Complexity Overall
  • There are 25 files with units, with 2,967 lines of code.
    • 0 very complex files (McCabe index sum 251+; 0 lines of code)
    • 0 complex files (McCabe index sum 126-250; 0 lines of code)
    • 1 medium complex files (McCabe index sum 51-125; 260 lines of code)
    • 2 slightly complex files (McCabe index sum 26-50; 232 lines of code)
    • 22 simple files (McCabe index sum 1-25; 2,475 lines of code)
  • 19 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 0% | 8% | 7% | 83%
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
rb0% | 0% | 8% | 7% | 83%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
lib0% | 0% | 37% | 33% | 28%
spec0% | 0% | 0% | 0% | 100%
Most Complex Files (Top 25)

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
object_serializer.rb
in lib/fast_jsonapi
260 28 87 33 7
serialization_core.rb
in lib/fast_jsonapi
129 11 42 33 12
relationship.rb
in lib/fast_jsonapi
103 11 27 26 5
movie_context.rb
in spec/shared/contexts
404 17 19 5 2
multi_to_json.rb
in lib/fast_jsonapi
78 9 19 24 3
js_context.rb
in spec/shared/contexts
105 8 8 8 1
js_group_context.rb
in spec/shared/contexts
94 6 6 6 1
attribute.rb
in lib/fast_jsonapi
26 3 6 23 3
ams_context.rb
in spec/shared/contexts
138 5 5 4 1
jsonapi_context.rb
in spec/shared/contexts
98 4 4 4 1
jsonapi_group_context.rb
in spec/shared/contexts
92 4 4 4 1
135 4 4 3 1
168 3 3 2 1
link.rb
in lib/fast_jsonapi
16 2 3 19 2
421 2 2 0 1
has_one.rb
in lib/extensions
12 1 2 17 2
serializer_generator.rb
in lib/generators/serializer
12 2 2 17 1
group_context.rb
in spec/shared/contexts
77 1 1 1 1
ams_group_context.rb
in spec/shared/contexts
72 1 1 1 1
381 1 1 0 1
90 1 1 1 1
serialized_json.rb
in lib/fast_jsonapi/instrumentation
11 1 1 9 1
serializable_hash.rb
in lib/fast_jsonapi/instrumentation
11 1 1 9 1
serialized_json.rb
in lib/fast_jsonapi/instrumentation/skylight/normalizers
17 1 1 6 1
serializable_hash.rb
in lib/fast_jsonapi/instrumentation/skylight/normalizers
17 1 1 6 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...