microsoft / pxt-ev3
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 820 units with 9,427 lines of code in units (97.6% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (168 lines of code)
    • 14 medium complex units (680 lines of code)
    • 29 simple units (777 lines of code)
    • 775 very simple units (7,802 lines of code)
0% | 1% | 7% | 8% | 82%
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
ts0% | 3% | 12% | 11% | 73%
js0% | 0% | 0% | 68% | 31%
cpp0% | 0% | 0% | 21% | 78%
swift0% | 0% | 0% | 0% | 100%
tsx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sim/state0% | 13% | 25% | 10% | 51%
sim/visuals0% | 3% | 19% | 2% | 75%
libs/core0% | 0% | 5% | 18% | 76%
scripts0% | 0% | 13% | 52% | 33%
libs/infrared-sensor0% | 0% | 16% | 0% | 83%
editor0% | 0% | 0% | 25% | 74%
fieldeditors0% | 0% | 0% | 23% | 76%
libs/screen0% | 0% | 0% | 27% | 72%
libs/music0% | 0% | 0% | 14% | 85%
sim0% | 0% | 0% | 25% | 75%
libs/color-sensor0% | 0% | 0% | 6% | 93%
legoresources0% | 0% | 0% | 0% | 100%
libs/storage0% | 0% | 0% | 0% | 100%
libs/ev30% | 0% | 0% | 0% | 100%
libs/gyro-sensor0% | 0% | 0% | 0% | 100%
libs/ultrasonic-sensor0% | 0% | 0% | 0% | 100%
libs/touch-sensor0% | 0% | 0% | 0% | 100%
libs/broadcast0% | 0% | 0% | 0% | 100%
libs/datalog0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function bindEvents()
in sim/visuals/util.ts
61 35 4
private updateStateStep()
in sim/state/motornode.ts
107 33 1
constructor()
in sim/state/output.ts
123 25 0
function detectDevices()
in libs/core/input.ts
68 22 0
private updateStateStep()
in sim/visuals/board.ts
45 21 1
private getControlForNode()
in sim/visuals/board.ts
49 17 3
private position()
in sim/visuals/layoutView.ts
121 14 0
function showMenu()
in scripts/file_manager.ts
26 13 0
constructor()
in sim/state/uart.ts
56 13 0
private getDisplayViewForNode()
in sim/visuals/board.ts
30 13 2
private updateLight()
in sim/visuals/nodes/brickView.ts
42 13 0
function mapButton()
in libs/infrared-sensor/ir.ts
16 12 1
unmapButtons()
in sim/state/infrared.ts
16 12 0
constructor()
in sim/visuals/board.ts
24 11 1
public setInput()
in sim/visuals/layoutView.ts
32 11 5
public setOutput()
in sim/visuals/layoutView.ts
32 11 5
66 10 1
talkAsync()
in editor/wrap.ts
20 10 2
refreshOptions()
in fieldeditors/field_music.ts
68 10 2
private normalizeSchedule()
in libs/core/output.ts
35 10 5