awslabs / aws-ec2rescue-linux
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 4,541 units with 47,426 lines of code in units (64.1% of code).
    • 2 very complex units (340 lines of code)
    • 19 complex units (1,657 lines of code)
    • 142 medium complex units (5,371 lines of code)
    • 412 simple units (8,190 lines of code)
    • 3,966 very simple units (31,868 lines of code)
<1% | 3% | 11% | 17% | 67%
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
py<1% | 3% | 11% | 17% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib<1% | 3% | 10% | 16% | 69%
ec2rlcore4% | 4% | 22% | 30% | 39%
tools0% | 0% | 0% | 91% | 8%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _iter()
in lib/dateutil/rrule.py
224 97 1
def setup()
in ec2rlcore/menu.py
116 57 2
def _parse_rfc()
in lib/dateutil/rrule.py
111 45 9
def _read_tzfile()
in lib/dateutil/tz/tz.py
99 41 2
def _parse()
in lib/dateutil/parser.py
274 38 6
def _parse_rfc()
in lib/dateutil/tz/tz.py
111 37 2
def rebuild()
in lib/dateutil/rrule.py
106 34 3
def resolve_ymd()
in lib/dateutil/parser.py
49 33 4
def do_command()
in ec2rlcore/menu_textpad_mod.py
64 33 2
def fetch_more_tokens()
in lib/python2/yaml/scanner.py
48 32 1
def fetch_more_tokens()
in lib/python3/yaml/scanner.py
48 32 1
def analyze_scalar()
in lib/python2/yaml/emitter.py
111 30 2
def analyze_scalar()
in lib/python3/yaml/emitter.py
111 30 2
def __add__()
in lib/dateutil/relativedelta.py
78 29 2
def parse_node()
in lib/python2/yaml/parser.py
94 29 3
def parse_node()
in lib/python3/yaml/parser.py
94 29 3
def gettz()
in lib/dateutil/tz/tz.py
69 27 1
def parse()
in lib/dateutil/parser.py
54 26 6
def __eq__()
in lib/dateutil/relativedelta.py
26 26 2
def parse_url()
in lib/urllib3/util/url.py
53 26 1