aws-cloudformation / cfn-lint
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 656 units with 10,583 lines of code in units (80.7% of code).
    • 4 very long units (589 lines of code)
    • 27 long units (1,775 lines of code)
    • 137 medium size units (4,103 lines of code)
    • 155 small units (2,312 lines of code)
    • 333 very small units (1,804 lines of code)
5% | 16% | 38% | 21% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 16% | 38% | 21% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/cfnlint11% | 16% | 35% | 24% | 13%
src/cfnlint/decode22% | 35% | 16% | 11% | 14%
src/cfnlint/rules/resources3% | 15% | 37% | 25% | 17%
src/cfnlint/rules/functions0% | 15% | 54% | 17% | 12%
src/cfnlint/rules0% | 21% | 28% | 19% | 30%
src/cfnlint/formatters0% | 31% | 34% | 9% | 23%
scripts0% | 22% | 29% | 29% | 18%
src/cfnlint/rules/custom0% | 27% | 19% | 49% | 2%
src/cfnlint/rules/parameters0% | 0% | 59% | 13% | 26%
src/cfnlint/rules/conditions0% | 0% | 97% | 0% | 2%
src/cfnlint/rules/outputs0% | 0% | 60% | 19% | 19%
src/cfnlint/rules/mappings0% | 0% | 48% | 11% | 39%
src/cfnlint/rules/metadata0% | 0% | 100% | 0% | 0%
src/cfnlint/rules/templates0% | 0% | 0% | 20% | 79%
src/cfnlint/decorators0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def cfn_json_object()
in src/cfnlint/decode/cfn_json.py
186 14 9
def propertycheck()
in src/cfnlint/rules/resources/properties/Properties.py
138 47 7
def get_schema_value_types()
in src/cfnlint/maintenance.py
137 49 0
def create_parser()
in src/cfnlint/config.py
128 7 1
def _check_resource()
in src/cfnlint/rules/resources/Configuration.py
97 25 4
def create_dict_node_class()
in src/cfnlint/decode/node.py
90 57 1
def resource_property()
in src/cfnlint/rules/__init__.py
83 27 7
def py_scanstring()
in src/cfnlint/decode/cfn_json.py
83 15 5
def get_scenarios()
in src/cfnlint/conditions.py
79 28 2
def match()
in src/cfnlint/rules/resources/RetentionPeriodOnResourceTypesWithAutoExpiringContent.py
76 13 2
def check_recordset()
in src/cfnlint/rules/resources/route53/RecordSet.py
72 13 4
def decode()
in src/cfnlint/decode/__init__.py
72 23 1
def print_matches()
in src/cfnlint/formatters/__init__.py
70 8 4
def get_values()
in src/cfnlint/template.py
69 24 4
def check_value_getatt()
in src/cfnlint/rules/resources/properties/ValueRefGetAtt.py
69 17 4
def update_resource_spec()
in src/cfnlint/maintenance.py
67 12 3
def _check_policy_statement()
in src/cfnlint/rules/resources/iam/Policy.py
64 16 5
def match()
in src/cfnlint/rules/functions/GetAtt.py
63 21 2
def __init__()
in src/cfnlint/graph.py
59 34 2
def _check_list_for_condition()
in src/cfnlint/rules/resources/properties/Properties.py
59 20 7