awslabs / smithy-ruby
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,565 units with 13,612 lines of code in units (47.6% of code).
    • 0 very complex units (0 lines of code)
    • 8 complex units (337 lines of code)
    • 17 medium complex units (454 lines of code)
    • 38 simple units (738 lines of code)
    • 1,502 very simple units (12,083 lines of code)
0% | 2% | 3% | 5% | 88%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
rb0% | 4% | 5% | 4% | 85%
java0% | 0% | 0% | 6% | 93%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
codegen/projections0% | 4% | 6% | 4% | 85%
codegen/smithy-ruby-codegen0% | 0% | 0% | 7% | 92%
seahorse/lib0% | 0% | 0% | 8% | 91%
codegen/smithy-ruby-rails-codegen0% | 0% | 0% | 4% | 95%
sample-service/app0% | 0% | 0% | 0% | 100%
seahorse/spec0% | 0% | 0% | 0% | 100%
sample-service/db0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
self.error_code
in codegen/projections/high_score_service/lib/high_score_service/errors.rb
50 47 1
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
59 38 2
self.stub
in codegen/projections/rails_json/lib/rails_json/stubs.rb
51 28 2
self.stub
in codegen/projections/rails_json/lib/rails_json/stubs.rb
31 28 1
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
51 28 2
self.stub
in codegen/projections/rails_json/lib/rails_json/stubs.rb
32 27 2
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
33 27 2
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
30 27 1
self.parse
in codegen/projections/rails_json/lib/rails_json/parsers.rb
34 24 1
self.parse
in codegen/projections/rails_json/lib/rails_json/parsers.rb
31 20 1
self.parse
in codegen/projections/rails_json/lib/rails_json/parsers.rb
30 20 1
self.parse
in codegen/projections/rails_json/lib/rails_json/parsers.rb
46 17 1
self.validate!
in codegen/projections/rails_json/lib/rails_json/validators.rb
29 15 2
self.validate!
in codegen/projections/rails_json/lib/rails_json/validators.rb
29 15 2
self.build
in codegen/projections/rails_json/lib/rails_json/params.rb
31 15 2
self.build
in codegen/projections/rails_json/lib/rails_json/params.rb
31 15 2
self.build
in codegen/projections/rails_json/lib/rails_json/params.rb
50 15 2
self.validate!
in codegen/projections/rails_json/lib/rails_json/validators.rb
26 13 2
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
27 13 1
self.parse
in codegen/projections/rails_json/lib/rails_json/parsers.rb
15 11 1