awslabs / collectd-cloudwatch
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 225 units with 1,600 lines of code in units (72.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (202 lines of code)
    • 5 simple units (70 lines of code)
    • 219 very simple units (1,328 lines of code)
0% | 0% | 12% | 4% | 83%
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
py0% | 0% | 12% | 4% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 28% | <1% | 71%
src/cloudwatch/modules0% | 0% | 0% | 17% | 82%
src/cloudwatch/modules/configuration0% | 0% | 0% | 7% | 92%
src/cloudwatch/modules/client0% | 0% | 0% | 0% | 100%
src/cloudwatch/modules/logger0% | 0% | 0% | 0% | 100%
src/cloudwatch/modules/collectd_integration0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in src/setup.py
202 24 0
4 9 2
def _aggregate_metric()
in src/cloudwatch/modules/flusher.py
25 9 2
def _flush()
in src/cloudwatch/modules/flusher.py
16 8 1
def _find_value_by_key()
in src/cloudwatch/modules/configuration/readerutils.py
14 7 2
def _parse_credentials_file()
in src/cloudwatch/modules/configuration/credentialsreader.py
11 7 1
def _get_metadata()
in src/setup.py
13 5 2
16 5 1
14 5 1
10 5 1
def get_iam_role_credentials()
in src/cloudwatch/modules/configuration/metadatareader.py
10 5 2
def _check_configuration_integrity()
in src/cloudwatch/modules/configuration/confighelper.py
9 5 1
def add_metric()
in src/cloudwatch/modules/flusher.py
6 5 2
def _flush_if_need()
in src/cloudwatch/modules/flusher.py
8 5 2
def run()
in src/setup.py
11 4 1
13 4 1
13 4 1
9 4 1
def run()
in src/setup.py
7 4 1
def _filter_valid_regexes()
in src/cloudwatch/modules/configuration/whitelist.py
3 4 2