microsoft / tiny-calc
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 364 units with 4,081 lines of code in units (39.9% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (360 lines of code)
    • 10 medium complex units (374 lines of code)
    • 37 simple units (1,000 lines of code)
    • 313 very simple units (2,347 lines of code)
0% | 8% | 9% | 24% | 57%
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% | 9% | 10% | 24% | 55%
js0% | 0% | 0% | 24% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/core/micro0% | 12% | 7% | 34% | 45%
packages/core/nano0% | 10% | 24% | 15% | 49%
common/scripts0% | 0% | 0% | 24% | 75%
experimental/graph/src0% | 0% | 0% | 15% | 84%
packages/common/datastructures0% | 0% | 0% | 0% | 100%
experimental/tree/src0% | 0% | 0% | 0% | 100%
experimental/graph/bench0% | 0% | 0% | 0% | 100%
packages/common/binary0% | 0% | 0% | 0% | 100%
experimental/tree/bench0% | 0% | 0% | 0% | 100%
packages/common/scheduler0% | 0% | 0% | 0% | 100%
packages/types/es0% | 0% | 0% | 0% | 100%
packages/types/type-utils0% | 0% | 0% | 0% | 100%
common/config/rush0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function partitionNode()
in packages/core/micro/src/adjust-tree/delete.ts
95 40 6
function scan()
in packages/core/nano/src/parser.ts
97 38 0
function parseCellRef()
in packages/core/micro/src/formula.ts
72 35 1
function rebuild()
in packages/core/micro/src/sheetlet.ts
96 32 2
export function evaluate()
in packages/core/nano/src/interpreter.ts
64 22 5
function isStartOfExpression()
in packages/core/nano/src/parser.ts
24 18 1
function tokenToString()
in packages/core/nano/src/parser.ts
21 16 1
function extractSegmentRange()
in packages/core/micro/src/permutation/index.ts
67 15 3
cellsChanged()
in packages/core/micro/src/sheetlet.ts
42 14 4
function compileAST()
in packages/core/nano/src/compiler.ts
49 14 1
export function forEachCellInColumns()
in packages/core/micro/src/matrix.ts
43 13 6
function isWhitespaceChar()
in packages/core/nano/src/parser.ts
18 13 1
function operatorPrecedence()
in packages/core/nano/src/parser.ts
20 12 1
app()
in packages/core/nano/src/ast.ts
26 11 5
function isIdentifierPart()
in packages/core/nano/src/parser.ts
11 10 1
function parseArgumentList()
in packages/core/nano/src/parser.ts
35 10 0
function reparent()
in packages/core/micro/src/adjust-tree/delete.ts
33 9 4
export function forEachCell()
in packages/core/micro/src/matrix.ts
33 9 4
export function forEachCellInColumn()
in packages/core/micro/src/matrix.ts
29 9 5
add()
in packages/core/micro/src/permutation/index.ts
31 9 1