microsoft / powerquery-parser
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 979 units with 11,577 lines of code in units (76.8% of code).
    • 5 very long units (592 lines of code)
    • 15 long units (973 lines of code)
    • 122 medium size units (3,971 lines of code)
    • 216 small units (3,080 lines of code)
    • 621 very small units (2,961 lines of code)
5% | 8% | 34% | 26% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts5% | 8% | 34% | 26% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/powerquery-parser/lexer16% | 9% | 36% | 20% | 17%
src/powerquery-parser/parser4% | 13% | 44% | 19% | 18%
src/powerquery-parser/localization43% | 0% | 42% | 10% | 3%
src/powerquery-parser/language0% | 4% | 26% | 39% | 29%
src/powerquery-parser/common0% | 0% | 10% | 24% | 64%
src0% | 0% | 70% | 29% | 0%
src/powerquery-parser/task0% | 0% | 0% | 31% | 68%
src/powerquery-parser/settings0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function localizeTokenKind()
in src/powerquery-parser/localization/localization.ts
130 63 2
export function readFieldSpecificationList()
in src/powerquery-parser/parser/parsers/naive.ts
124 8 4
function tokenizeDefault()
in src/powerquery-parser/lexer/lexer.ts
120 41 4
function tokenize()
in src/powerquery-parser/lexer/lexer.ts
116 18 4
function genericReadParameterList()
in src/powerquery-parser/parser/parsers/naive.ts
102 6 3
function readBinOpExpression()
in src/powerquery-parser/parser/parsers/combinatorialParser.ts
91 8 3
function tryReadPrimitiveType()
in src/powerquery-parser/parser/parsers/naive.ts
90 22 2
export function readRecursivePrimaryExpression()
in src/powerquery-parser/parser/parsers/naive.ts
82 5 3
function maybeKeywordLineTokenKindFrom()
in src/powerquery-parser/lexer/lexer.ts
68 32 1
function createSnapshot()
in src/powerquery-parser/lexer/lexerSnapshot.ts
67 7 1
function addToCategory()
in src/powerquery-parser/language/type/typeUtils/categorize.ts
66 22 2
export function iterSection()
in src/powerquery-parser/parser/nodeIdMap/nodeIdMapIterator.ts
66 6 2
function applyDelta()
in src/powerquery-parser/parser/nodeIdMap/nodeIdMapUtils/idUtils.ts
64 16 4
export function readPrimaryExpression()
in src/powerquery-parser/parser/parsers/naive.ts
58 17 2
function addTypeIfUniqueType()
in src/powerquery-parser/language/type/typeUtils/categorize.ts
55 9 2
function readUnaryExpression()
in src/powerquery-parser/parser/parsers/combinatorialParser.ts
54 24 2
export function readGeneralizedIdentifier()
in src/powerquery-parser/parser/parsers/naive.ts
54 5 2
export function maybeDisambiguateParenthesis()
in src/powerquery-parser/parser/disambiguation/disambiguationUtils.ts
53 11 2
function readCsvArray()
in src/powerquery-parser/parser/parsers/naive.ts
53 3 2
export function isCompatible()
in src/powerquery-parser/language/type/typeUtils/isCompatible.ts
52 30 2