microsoft / contact-card
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 48 units with 583 lines of code in units (43.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 5 medium size units (142 lines of code)
    • 18 small units (259 lines of code)
    • 24 very small units (128 lines of code)
0% | 9% | 24% | 44% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 56% | 0% | 20% | 23%
tsx0% | 0% | 50% | 26% | 22%
ts0% | 0% | 12% | 66% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts0% | 77% | 0% | 0% | 22%
src/contactCard0% | 0% | 62% | 25% | 12%
src0% | 0% | 19% | 53% | 26%
src/supporting0% | 0% | 0% | 86% | 13%
config/jest0% | 0% | 0% | 76% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function build()
in scripts/build.js
54 10 1
async function processBatch()
in src/GraphService.ts
33 5 0
function renderOrgSummary()
in src/contactCard/Summary.tsx
30 4 3
export function renderOrgHierarchy()
in src/contactCard/OrgDetails.tsx
29 2 4
public render()
in src/PersonaWithCard.tsx
28 1 0
function renderDirects()
in src/contactCard/OrgDetails.tsx
22 3 2
process()
in config/jest/fileTransform.js
19 2 2
async function enqueueRequest()
in src/GraphService.ts
18 3 2
function renderAllManagers()
in src/contactCard/OrgDetails.tsx
18 2 2
16 4 1
16 2 1
15 3 1
export function renderSummary()
in src/contactCard/Summary.tsx
15 1 4
14 2 1
14 2 1
function buildProfile()
in src/GraphService.ts
14 5 1
export function buildProfileResponse()
in src/supporting/Profile.ts
14 1 1
export function buildProfile()
in src/supporting/Profile.ts
14 1 1
function cacheByIdOrEmail()
in src/GraphService.ts
13 3 3
public render()
in src/Persona.tsx
13 4 0