awslabs / diagram-maker
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 262 units with 3,774 lines of code in units (41.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (472 lines of code)
    • 9 simple units (338 lines of code)
    • 248 very simple units (2,964 lines of code)
0% | 0% | 12% | 8% | 78%
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% | 0% | 14% | 10% | 75%
tsx0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/state0% | 0% | 30% | 12% | 56%
integ/ActionInterceptor0% | 0% | 0% | 100% | 0%
src/service0% | 0% | 0% | 9% | 90%
src/components0% | 0% | 0% | 0% | 100%
integ0% | 0% | 0% | 0% | 100%
cypress/common0% | 0% | 0% | 0% | 100%
integ/Plugins0% | 0% | 0% | 0% | 100%
integ/DarkTheme0% | 0% | 0% | 0% | 100%
integ/BoundaryRectangular0% | 0% | 0% | 0% | 100%
integ/TopBottomRectangular0% | 0% | 0% | 0% | 100%
integ/LeftRightRectangular0% | 0% | 0% | 0% | 100%
integ/Layout0% | 0% | 0% | 0% | 100%
integ/BoundaryCircular0% | 0% | 0% | 0% | 100%
src/testing0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function applyGravity()
in src/state/layout/hierarchicalLayout.ts
71 23 3
export default function nodeReducer()
in src/state/node/nodeReducer.ts
121 22 2
function arrangeEvenly()
in src/state/layout/hierarchicalLayout.ts
92 18 3
export default function hierarchicalLayout()
in src/state/layout/hierarchicalLayout.ts
98 14 2
export default function workspaceReducer()
in src/state/workspace/workspaceReducer.ts
90 13 2
export default function editorReducer()
in src/state/editor/editorReducer.ts
48 10 2
export default function edgeReducer()
in src/state/edge/edgeReducer.ts
60 10 2
export default function panelReducer()
in src/state/panel/panelReducer.ts
29 9 2
public static getTarget()
in src/service/ui/UITargetNormalizer.ts
23 8 3
export function handleEdgeCreate()
in src/state/edge/edgeActionDispatcher.ts
15 7 3
export default function potentialNodeReducer()
in src/state/node/potentialNodeReducer.ts
27 6 2
export default function potentialEdgeReducer()
in src/state/edge/potentialEdgeReducer.ts
24 6 2
public static normalizeKeyboardEvent()
in src/service/ui/UIEventNormalizer.ts
24 6 3
export function renderDiagramMaker()
in integ/ActionInterceptor/render.ts
88 6 0
function getPanelElement()
in src/state/panel/panelActionDispatcher.ts
7 5 1
function getSizeFromDataAttrs()
in src/state/node/nodeActionDispatcher.ts
12 5 1
export default function layoutReducer()
in src/state/layout/layoutReducer.ts
21 5 2
public static normalizeTarget()
in src/service/ui/UITargetNormalizer.ts
7 5 1
export function getRequiredAttribute()
in src/service/ui/UIEventNormalizer.ts
8 5 1
private getFilteredConnectors()
in src/components/node/Node.tsx
16 5 0