awslabs / collectd-cloudwatch
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 225 units with 1,600 lines of code in units (72.8% of code).
    • 1 very long units (202 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (76 lines of code)
    • 30 small units (429 lines of code)
    • 191 very small units (893 lines of code)
12% | 0% | 4% | 26% | 55%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 0% | 4% | 26% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src28% | 0% | 7% | 22% | 42%
src/cloudwatch/modules0% | 0% | 10% | 29% | 60%
src/cloudwatch/modules/configuration0% | 0% | 0% | 31% | 68%
src/cloudwatch/modules/client0% | 0% | 0% | 36% | 63%
src/cloudwatch/modules/logger0% | 0% | 0% | 0% | 100%
src/cloudwatch/modules/collectd_integration0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in src/setup.py
202 24 0
def run()
in src/setup.py
26 3 1
def __init__()
in src/setup.py
25 1 20
def _aggregate_metric()
in src/cloudwatch/modules/flusher.py
25 9 2
def __init__()
in src/cloudwatch/modules/configuration/configreader.py
20 2 2
def __init__()
in src/cloudwatch/modules/configuration/confighelper.py
20 1 3
def _load_configuration()
in src/cloudwatch/modules/configuration/confighelper.py
20 1 1
def _debug_setup()
in src/setup.py
19 1 1
def __init__()
in src/setup.py
18 1 13
def _expand_value_list()
in src/cloudwatch/modules/flusher.py
18 4 2
16 5 1
def _flush()
in src/cloudwatch/modules/flusher.py
16 8 1
def get_autoscaling_group()
in src/cloudwatch/modules/client/ec2getclient.py
16 2 2
def _prepare_config()
in src/setup.py
15 1 1
def _v2_call()
in src/setup.py
14 2 2
14 5 1
def _find_value_by_key()
in src/cloudwatch/modules/configuration/readerutils.py
14 7 2
def _v2_call()
in src/cloudwatch/modules/configuration/metadatareader.py
14 4 2
def _prepare_session()
in src/cloudwatch/modules/client/putclient.py
14 3 1
def _get_metadata()
in src/setup.py
13 5 2