microsoft / service-fabric-explorer
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 2,608 units with 20,642 lines of code in units (39.0% of code).
    • 4 very long units (527 lines of code)
    • 28 long units (1,851 lines of code)
    • 143 medium size units (4,165 lines of code)
    • 316 small units (4,504 lines of code)
    • 2,117 very small units (9,595 lines of code)
2% | 8% | 20% | 21% | 46%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts2% | 8% | 20% | 21% | 46%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sfx/App/Scripts4% | 8% | 19% | 21% | 45%
Sfx-Standalone/modules/main-window21% | 0% | 29% | 22% | 26%
SfxWeb/src/app0% | 9% | 18% | 21% | 50%
Sfx-Standalone/modules/prompt.select-certificate0% | 100% | 0% | 0% | 0%
Sfx-Standalone/modules/http0% | 12% | 38% | 19% | 30%
Sfx-Standalone/modules/browser-window0% | 0% | 70% | 15% | 14%
Sfx-Standalone0% | 0% | 63% | 16% | 19%
Sfx-Standalone/modules/prompt0% | 0% | 43% | 0% | 56%
Sfx-Standalone/modules/update0% | 0% | 43% | 56% | 0%
Sfx-Standalone/modules/cert0% | 0% | 0% | 100% | 0%
Sfx-Standalone/utilities0% | 0% | 0% | 70% | 29%
Sfx-Standalone/modules0% | 0% | 0% | 57% | 42%
Sfx0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
(function ()()
in src/Sfx/App/Scripts/Directives/Directives.ts
200 1 1
(function ()()
in src/Sfx/App/Scripts/Services/RoutesService.ts
121 1 1
private async setupClusterListItemHandler()
in src/Sfx-Standalone/modules/main-window/cluster-list/cluster-list.script.ts
103 18 3
public setAdvancedActions()
in src/Sfx/App/Scripts/Models/DataModels/Partition.ts
103 13 0
public static getViewPathUrl()
in src/SfxWeb/src/app/Utils/healthUtils.ts
88 15 3
public static getViewPathUrl()
in src/Sfx/App/Scripts/Utils/Utils.ts
86 16 3
constructor()
in src/Sfx-Standalone/modules/prompt.select-certificate/select-certificate.ts
83 16 1
attemptSetActions()
in src/SfxWeb/src/app/views/partition/backups/backups.component.ts
81 10 0
function handleRequestAsync()
in src/Sfx-Standalone/modules/http/request-handlers/electron.ts
78 12 3
export function parseEventsGenerically()
in src/Sfx/App/Scripts/Models/eventstore/timelineGenerators.ts
70 11 2
export function parseEventsGenerically()
in src/SfxWeb/src/app/Models/eventstore/timelineGenerators.ts
70 11 2
ngOnChanges()
in src/SfxWeb/src/app/modules/partition-replication/replica-status/replica-status.component.ts
70 1 0
private setAdvancedActions()
in src/Sfx/App/Scripts/Models/DataModels/Application.ts
69 15 0
private setAdvancedActions()
in src/Sfx/App/Scripts/Models/DataModels/Service.ts
69 16 0
private getGroupNodes()
in src/Sfx/App/Scripts/Services/ClusterTreeService.ts
69 3 0
public constructor()
in src/Sfx/App/Scripts/Controllers/ImageStoreViewController.ts
65 12 3
setUpActions()
in src/SfxWeb/src/app/views/application/backup/backup.component.ts
65 15 0
setupActions()
in src/SfxWeb/src/app/views/service/backup/backup.component.ts
65 15 0
public setAdvancedActions()
in src/SfxWeb/src/app/Models/DataModels/Node.ts
64 7 0
private static ensureResourceGovernanceMetrics()
in src/Sfx/App/Scripts/ViewModels/MetricsViewModel.ts
63 5 1