aws-cloudformation / cloudformation-cli
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 325 units with 3,462 lines of code in units (72.6% of code).
    • 1 very long units (106 lines of code)
    • 4 long units (264 lines of code)
    • 29 medium size units (866 lines of code)
    • 80 small units (1,153 lines of code)
    • 211 very small units (1,073 lines of code)
3% | 7% | 25% | 33% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 7% | 25% | 33% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/rpdk/core6% | 13% | 35% | 22% | 22%
src/rpdk/core/contract0% | 5% | 15% | 44% | 34%
src/rpdk/core/jsonutils0% | 0% | 24% | 30% | 44%
src/rpdk/core/fragment0% | 0% | 9% | 47% | 42%
src/rpdk/core/resource0% | 0% | 30% | 34% | 35%
src/rpdk/core/utils0% | 0% | 0% | 73% | 26%
src/rpdk/core/module0% | 0% | 0% | 42% | 57%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def load_resource_spec()
in src/rpdk/core/data_loaders.py
106 19 1
def main()
in src/rpdk/core/cli.py
79 4 1
def __set_property_type()
in src/rpdk/core/project.py
74 16 2
def _call()
in src/rpdk/core/contract/resource_client.py
58 5 2
def invoke()
in src/rpdk/core/invoke.py
53 5 1
def _create_or_update_stack()
in src/rpdk/core/upload.py
49 7 3
def _wait_for_registration()
in src/rpdk/core/project.py
46 5 3
def schema_merge()
in src/rpdk/core/jsonutils/utils.py
44 20 3
def write_settings()
in src/rpdk/core/project.py
42 4 1
def get_temporary_credentials()
in src/rpdk/core/boto_helpers.py
40 5 3
def generate()
in src/rpdk/core/project.py
37 12 1
def _flatten_object_type()
in src/rpdk/core/jsonutils/flattener.py
35 12 3
def call()
in src/rpdk/core/contract/resource_client.py
31 7 5
def setup_subparser()
in src/rpdk/core/test.py
31 2 2
def generate_docs()
in src/rpdk/core/project.py
31 6 1
def generate_string_strategy()
in src/rpdk/core/contract/resource_generator.py
30 8 1
def __build_parameters()
in src/rpdk/core/fragment/generator.py
28 4 1
def compare()
in src/rpdk/core/contract/resource_client.py
27 6 4
def setup_subparser()
in src/rpdk/core/invoke.py
27 1 2
def get_overrides()
in src/rpdk/core/test.py
27 7 4