microsoft / powerquery-parser
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 979 units with 11,577 lines of code in units (76.8% of code).
    • 1 very complex units (130 lines of code)
    • 4 complex units (283 lines of code)
    • 23 medium complex units (1,101 lines of code)
    • 55 simple units (1,767 lines of code)
    • 896 very simple units (8,296 lines of code)
1% | 2% | 9% | 15% | 71%
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
ts1% | 2% | 9% | 15% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/powerquery-parser/localization43% | 0% | 0% | 0% | 56%
src/powerquery-parser/lexer0% | 13% | 12% | 7% | 66%
src/powerquery-parser/language0% | 1% | 12% | 15% | 70%
src/powerquery-parser/parser0% | <1% | 8% | 18% | 72%
src/powerquery-parser/common0% | 0% | 0% | 12% | 87%
src0% | 0% | 0% | 100% | 0%
src/powerquery-parser/task0% | 0% | 0% | 0% | 100%
src/powerquery-parser/settings0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function localizeTokenKind()
in src/powerquery-parser/localization/localization.ts
130 63 2
function tokenizeDefault()
in src/powerquery-parser/lexer/lexer.ts
120 41 4
export function isOnGeneralizedIdentifierStart()
in src/powerquery-parser/parser/parseState/parseStateUtils.ts
43 34 2
function maybeKeywordLineTokenKindFrom()
in src/powerquery-parser/lexer/lexer.ts
68 32 1
export function isCompatible()
in src/powerquery-parser/language/type/typeUtils/isCompatible.ts
52 30 2
function readUnaryExpression()
in src/powerquery-parser/parser/parsers/combinatorialParser.ts
54 24 2
function addToCategory()
in src/powerquery-parser/language/type/typeUtils/categorize.ts
66 22 2
function createCategory()
in src/powerquery-parser/language/type/typeUtils/categorize.ts
48 22 1
export function isTPrimitiveType()
in src/powerquery-parser/language/type/typeUtils/isType.ts
29 22 1
export function maybePrimitiveTypeConstantKindFromTypeKind()
in src/powerquery-parser/language/type/typeUtils/primitive.ts
49 22 1
function tryReadPrimitiveType()
in src/powerquery-parser/parser/parsers/naive.ts
90 22 2
export function isTypeKind()
in src/powerquery-parser/language/type/typeUtils/typeUtils.ts
27 21 1
export function typeKindFromPrimitiveTypeConstantKind()
in src/powerquery-parser/language/type/typeUtils/primitive.ts
46 20 1
export function maybeBinOpExpressionOperatorKindFrom()
in src/powerquery-parser/language/constant/constantUtils.ts
42 18 1
export function binOpExpressionOperatorPrecedence()
in src/powerquery-parser/language/constant/constantUtils.ts
33 18 1
export function isEqualExtendedTypes()
in src/powerquery-parser/language/type/typeUtils/isEqualType.ts
41 18 2
export function nameOf()
in src/powerquery-parser/language/type/typeUtils/nameOf.ts
40 18 1
function tokenize()
in src/powerquery-parser/lexer/lexer.ts
116 18 4
function binOpExpressionNodeKindFrom()
in src/powerquery-parser/parser/parsers/combinatorialParser.ts
31 18 1
export function readPrimaryExpression()
in src/powerquery-parser/parser/parsers/naive.ts
58 17 2