aws-samples / aws-mlu-explain
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 281 units with 6,565 lines of code in units (7.8% of code).
    • 1 very complex units (194 lines of code)
    • 1 complex units (271 lines of code)
    • 0 medium complex units (0 lines of code)
    • 18 simple units (895 lines of code)
    • 261 very simple units (5,205 lines of code)
2% | 4% | 0% | 13% | 79%
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
js2% | 4% | 0% | 12% | 79%
py0% | 0% | 0% | 100% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
js30% | 0% | 0% | 24% | 45%
code/decision-tree0% | 12% | 0% | 25% | 61%
code/bias-variance0% | 0% | 0% | 9% | 90%
code/double-descent0% | 0% | 0% | 0% | 100%
code/double-descent20% | 0% | 0% | 0% | 100%
code/parcel-mlu-explain-starter0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function p()
in js/rough-notation.js
194 56 6
drawPackedCircles()
in code/decision-tree/js/EntropyTree.js
271 33 0
function updateNodePositions()
in code/decision-tree/js/EntropyBubble.js
76 10 0
positionErrorBarsAsLabels()
in code/bias-variance/js/ErrorBar.js
108 10 0
drawDepth()
in code/decision-tree/js/DecisionTree.js
73 9 1
plotComplexCircleAll()
in code/bias-variance/js/ErrorBar.js
70 9 0
attach()
in js/rough-notation.js
32 8 0
constructor()
in code/decision-tree/js/EntropyTree.js
26 8 1
def viz()
in code/decision-tree/python/viz.py
58 8 2
function f()
in js/rough-notation.js
46 7 7
function l()
in js/rough-notation.js
38 7 3
constructor()
in code/decision-tree/js/EntropyBubble.js
93 7 1
addButtons()
in code/decision-tree/js/EntropyBubble.js
54 7 0
function n()
in js/rough-notation.js
15 6 3
attachListeners()
in js/rough-notation.js
12 6 0
show()
in js/rough-notation.js
11 6 0
function mousemove()
in code/decision-tree/js/InformationGainScatter.js
75 6 1
function mousemove()
in code/decision-tree/js/InformationGainLine.js
72 6 1
function entropy()
in code/decision-tree/js/EntropyBubble.js
19 6 1
function prob()
in code/decision-tree/js/EntropyBubble.js
17 6 1