microsoft / PowerBI-JavaScript
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 133 units with 1,406 lines of code in units (53.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (74 lines of code)
    • 7 medium size units (193 lines of code)
    • 49 small units (664 lines of code)
    • 76 very small units (475 lines of code)
0% | 5% | 13% | 47% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 5% | 13% | 47% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 5% | 13% | 47% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in src/service.ts
74 2 4
private setIframe()
in src/embed.ts
37 8 3
34 5 9
async load()
in src/embed.ts
29 8 1
async getPageByName()
in src/report.ts
26 4 1
async getActivePage()
in src/report.ts
23 3 0
private embedExisting()
in src/service.ts
23 8 3
21 5 1
constructor()
in src/embed.ts
20 3 6
async updateSettings()
in src/report.ts
19 6 1
19 3 2
19 8 1
19 3 0
18 5 1
18 3 2
private handleEvent()
in src/service.ts
17 4 1
async setAccessToken()
in src/embed.ts
16 6 1
async switchMode()
in src/report.ts
16 3 1
15 4 1
async setPage()
in src/report.ts
15 3 1