aws-samples / aws-builders-fair-projects
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 19,904 units with 179,222 lines of code in units (62.8% of code).
    • 7 very complex units (1,285 lines of code)
    • 67 complex units (5,197 lines of code)
    • 606 medium complex units (25,599 lines of code)
    • 1,648 simple units (36,102 lines of code)
    • 17,576 very simple units (111,039 lines of code)
<1% | 2% | 14% | 20% | 61%
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% | 14% | 19% | 61%
js0% | <1% | 15% | 23% | 60%
cs0% | 8% | 5% | 20% | 65%
ino0% | 0% | 0% | 37% | 62%
java0% | 0% | 0% | 15% | 84%
ts0% | 0% | 0% | 14% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
reinvent-2019/smart-garden5% | 10% | 19% | 12% | 51%
reinvent-2020/RhythmCloud<1% | 2% | 14% | 21% | 62%
reinvent-2019/rhythm-cloud<1% | 3% | 14% | 19% | 62%
reinvent-2019/connected-photo-booth6% | 2% | 16% | 26% | 48%
reinvent-2019/learn-languages-ai-ml0% | 6% | 3% | 18% | 71%
reinvent-2020/aws-smart-recycle0% | 1% | 21% | 29% | 47%
reinvent-2019/iot-racing-ninja0% | 3% | 13% | 26% | 56%
reinvent-2019/drone-zone0% | 0% | 22% | 0% | 77%
reinvent-2019/automatic-anomaly-detection-tool0% | 0% | 8% | 19% | 71%
reinvent-2019/fully-automated-farm0% | 0% | 8% | 0% | 91%
reinvent-2019/lego-ev3-raspberry-pi-robot0% | 0% | 5% | 18% | 75%
reinvent-2019/sign-and-speak0% | 0% | 27% | 4% | 67%
reinvent-2019/deeppens0% | 0% | 36% | 0% | 63%
reinvent-2019/autoponics0% | 0% | 30% | 0% | 69%
reinvent-2019/polyglot-bot0% | 0% | 0% | 31% | 68%
reinvent-2019/doodlechallenge0% | 0% | 0% | 3% | 96%
reinvent-2019/puente0% | 0% | 0% | 18% | 81%
reinvent-2019/smart-garage0% | 0% | 0% | 4% | 95%
reinvent-2020/rock-a-bye-baby0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _iter()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/rrule.py
224 97 1
def _iter()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/rrule.py
224 97 1
def _iter()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/rrule.py
224 97 1
def customCallback()
in reinvent-2019/connected-photo-booth/py_client/cerebro_processor.py
259 61 3
def _read_tzfile()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/tz/tz.py
102 56 2
def _read_tzfile()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/tz/tz.py
102 56 2
def _parse_rfc()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/rrule.py
150 54 10
def _parse_numeric_token()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/parser/_parser.py
88 46 7
def _parse_numeric_token()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/parser/_parser.py
88 46 7
def _parse_numeric_token()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/parser/_parser.py
88 46 7
def _read_tzfile()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/tz/tz.py
100 41 2
def _parse_rfc()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/rrule.py
114 41 10
def _parse_rfc()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/rrule.py
114 41 10
def is_invalid()
in reinvent-2020/aws-smart-recycle/pi/lambda/gg-pi-recycle/greengrasssdk/stream_manager/utilinternal.py
83 41 1
def resolve_ymd()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/parser/_parser.py
62 40 3
def resolve_ymd()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/parser/_parser.py
62 40 3
def resolve_ymd()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/parser/_parser.py
62 40 3
def _parse_rfc()
in reinvent-2019/smart-garden/lambdasGreengrass-Edge/lambdas/WaterPumpControl/vendored/dateutil/tz/tz.py
116 39 2
def _parse_rfc()
in reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/dateutil/tz/tz.py
116 39 2
def _parse_rfc()
in reinvent-2020/RhythmCloud/lambda/Greengrass_startSong/dateutil/tz/tz.py
116 39 2