aws-cloudformation / cloudformation-guard
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 216 units with 3,698 lines of code in units (53.9% of code).
    • 3 very long units (683 lines of code)
    • 9 long units (545 lines of code)
    • 37 medium size units (1,263 lines of code)
    • 45 small units (616 lines of code)
    • 122 very small units (591 lines of code)
18% | 14% | 34% | 16% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs18% | 14% | 34% | 16% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
guard/src18% | 14% | 34% | 16% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn evaluate()
in guard/src/rules/evaluate.rs
278 19 3
fn select()
in guard/src/rules/path_value.rs
247 22 4
fn execute()
in guard/src/commands/validate.rs
158 12 2
fn clause_with_map()
in guard/src/rules/parser.rs
73 3 3
fn test_with_data()
in guard/src/commands/test.rs
67 7 3
fn fmt()
in guard/src/rules/values.rs
64 7 2
fn compare()
in guard/src/rules/evaluate.rs
62 18 7
fn try_into()
in guard/src/rules/path_value.rs
58 9 1
fn report()
in guard/src/commands/validate/cfn_reporter.rs
57 3 8
fn report()
in guard/src/commands/validate/cfn_reporter.rs
56 6 6
fn evaluate Result()
in guard/src/rules/evaluate.rs
55 7 3
fn error_kind_msg()
in guard/src/rules/errors.rs
53 1 1
fn execute()
in guard/src/commands/test.rs
49 11 2
fn report()
in guard/src/commands/validate/generic_summary.rs
49 6 6
fn report()
in guard/src/commands/validate.rs
45 8 1
fn evaluate_against_data_input()
in guard/src/commands/validate.rs
45 4 4
fn assignment()
in guard/src/rules/parser.rs
43 5 1
fn eq()
in guard/src/rules/path_value.rs
41 3 2
fn evaluate Result()
in guard/src/rules/evaluate.rs
41 8 2
fn try_from()
in guard/src/rules/path_value.rs
40 4 2