microsoft / tsdoc
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 566 units with 8,102 lines of code in units (40.2% of code).
    • 9 very long units (1,363 lines of code)
    • 19 long units (1,294 lines of code)
    • 68 medium size units (2,264 lines of code)
    • 88 small units (1,325 lines of code)
    • 382 very small units (1,856 lines of code)
16% | 15% | 27% | 16% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts18% | 16% | 26% | 14% | 24%
tsx13% | 22% | 32% | 17% | 14%
js0% | 0% | 46% | 41% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tsdoc/src18% | 16% | 23% | 14% | 26%
playground/src23% | 16% | 32% | 15% | 11%
tsdoc-config/src0% | 30% | 27% | 20% | 21%
api-demo/src0% | 0% | 81% | 16% | 2%
common/scripts0% | 0% | 46% | 41% | 11%
eslint-plugin/src0% | 0% | 85% | 0% | 15%
spec/code-snippets0% | 0% | 0% | 0% | 100%
common/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private _renderNode()
in tsdoc/src/emitters/TSDocEmitter.ts
225 49 1
private _parseDeclarationReference()
in tsdoc/src/parser/NodeParser.ts
196 52 3
private _parseFencedCode()
in tsdoc/src/parser/NodeParser.ts
189 24 1
private _parseInlineTag()
in tsdoc/src/parser/NodeParser.ts
147 17 1
public static _getStylesForDocCommentInternal()
in playground/src/SyntaxStyler/DocNodeSyntaxStyler.ts
142 41 2
private _parseLinkTag()
in tsdoc/src/parser/NodeParser.ts
129 25 2
public static extract()
in tsdoc/src/parser/LineExtractor.ts
118 28 1
private _parseParamBlock()
in tsdoc/src/parser/NodeParser.ts
116 11 3
private _renderElements()
in playground/src/DocHtmlView.tsx
101 12 0
public parse()
in tsdoc/src/parser/NodeParser.ts
99 16 0
private _parseMemberReference()
in tsdoc/src/parser/NodeParser.ts
94 13 4
private _parseMemberIdentifier()
in tsdoc/src/parser/NodeParser.ts
86 10 3
public constructor()
in tsdoc/src/nodes/DocMemberReference.ts
81 12 1
private _loadWithExtends()
in tsdoc-config/src/TSDocConfigFile.ts
76 11 3
public constructor()
in tsdoc/src/nodes/DocParamBlock.ts
74 11 1
public static transform()
in tsdoc/src/transforms/TrimSpacesTransform.ts
71 14 1
function tokenToString()
in tsdoc/src/beta/DeclarationReference.ts
70 34 1
private _parseBlockTag()
in tsdoc/src/parser/NodeParser.ts
68 12 1
public render()
in playground/src/TabPane.tsx
66 5 0
private _parseHtmlStartTag()
in tsdoc/src/parser/NodeParser.ts
65 7 1