microsoft / sarif-web-component
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 36 units with 572 lines of code in units (25.3% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (240 lines of code)
    • 3 medium size units (102 lines of code)
    • 7 small units (101 lines of code)
    • 22 very small units (129 lines of code)
0% | 41% | 17% | 17% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx0% | 31% | 18% | 21% | 28%
ts0% | 65% | 17% | 8% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
components0% | 46% | 19% | 11% | 21%
docs-components0% | 0% | 0% | 75% | 24%
ROOT0% | 0% | 0% | 63% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in components/RunCard.tsx
66 8 0
render()
in components/Viewer.tsx
61 14 0
constructor()
in components/RunStore.ts
59 17 6
private filterHelper()
in components/RunStore.ts
54 18 1
constructor()
in components/RunCard.tsx
38 2 1
render()
in components/FilterBar.tsx
34 6 0
export function getRepoUri()
in components/getRepoUri.ts
30 12 3
function renderMessageWithEmbeddedLinks()
in components/RunCard.renderCell.tsx
19 5 2
function openInNewTab()
in components/RunCard.renderPathCell.tsx
16 1 3
private processSortEvent()
in components/RunCard.TreeColumnSorting.ts
14 5 1
componentDidMount()
in docs-components/Shield.tsx
14 1 0
render()
in index.tsx
14 1 0
export function PathCellDemo()
in components/PathCellDemo.tsx
13 1 0
render()
in docs-components/Index.tsx
11 1 0
constructor()
in components/FilterBar.tsx
8 4 2
yield clone()
in components/PathCellDemo.tsx
8 1 1
yield clone()
in components/PathCellDemo.tsx
8 1 1
yield clone()
in components/PathCellDemo.tsx
8 1 1
className: css()
in components/RunCard.renderCell.tsx
8 3 2
function getHostname()
in components/getRepoUri.ts
8 3 1