microsoft / accessibility-insights-service
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 739 units with 7,591 lines of code in units (55.7% of code).
    • 2 very long units (306 lines of code)
    • 2 long units (116 lines of code)
    • 85 medium size units (2,468 lines of code)
    • 142 small units (2,069 lines of code)
    • 508 very small units (2,632 lines of code)
4% | 1% | 32% | 27% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts4% | 1% | 32% | 27% | 34%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/common41% | 0% | 4% | 23% | 30%
packages/cli16% | 7% | 14% | 31% | 29%
packages/crawler0% | 9% | 24% | 20% | 45%
packages/azure-services0% | 0% | 36% | 32% | 30%
packages/service-library0% | 0% | 40% | 33% | 26%
packages/web-api-scan-runner0% | 0% | 38% | 35% | 25%
packages/web-api0% | 0% | 45% | 26% | 28%
packages/web-workers0% | 0% | 43% | 13% | 43%
packages/web-api-scan-request-sender0% | 0% | 65% | 21% | 12%
packages/privacy-scan-runner0% | 0% | 42% | 17% | 40%
packages/web-api-send-notification-runner0% | 0% | 59% | 10% | 30%
packages/privacy-scan-job-manager0% | 0% | 45% | 10% | 44%
packages/web-api-scan-job-manager0% | 0% | 45% | 10% | 44%
packages/axe-result-converter0% | 0% | 58% | 0% | 41%
packages/scanner-global-library0% | 0% | 26% | 14% | 59%
packages/health-client0% | 0% | 39% | 27% | 33%
packages/parallel-workers0% | 0% | 58% | 33% | 7%
packages/web-api-client0% | 0% | 0% | 79% | 20%
packages/logger0% | 0% | 0% | 22% | 77%
ROOT0% | 0% | 0% | 100% | 0%
packages/web-api-send-notification-job-manager0% | 0% | 0% | 17% | 82%
packages/e2e-web-apis0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private getRuntimeConfigSchema()
in packages/common/src/configuration/service-configuration.ts
194 1 0
function getScanArguments()
in packages/cli/src/cli.ts
112 3 0
public async start()
in packages/crawler/src/crawler/puppeteer-crawler-engine.ts
64 4 1
public updateResultsInPlace()
in packages/cli/src/baseline/baseline-engine.ts
52 14 2
private async sendNotificationWithRetry()
in packages/web-api-send-notification-runner/src/sender/notification-sender.ts
48 7 1
private async writeRequestsToPermanentContainer()
in packages/web-workers/src/controllers/scan-batch-request-feed-controller.ts
48 5 2
public async readItems()
in packages/azure-services/src/azure-cosmos/cosmos-client-wrapper.ts
43 6 5
public async mergeOrWriteDocument()
in packages/azure-services/src/storage/cosmos-container-client.ts
43 4 3
private async readPartDocument()
in packages/service-library/src/data-providers/website-scan-result-provider.ts
43 3 1
private async addTaskCollection()
in packages/azure-services/src/azure-batch/batch.ts
41 6 2
public async run()
in packages/health-client/src/deployment-health-checker.ts
41 9 4
private async canSendNotification()
in packages/web-api-scan-runner/src/sender/scan-notification-processor.ts
41 13 3
private createCompletedScanResponse()
in packages/web-api/src/converters/scan-response-converter.ts
41 6 4
private async trace()
in packages/web-api-scan-request-sender/src/sender/on-demand-dispatcher.ts
40 7 1
private getHealthReport()
in packages/web-api/src/controllers/health-check-controller.ts
39 5 2
public async readCombinedResults()
in packages/service-library/src/data-providers/combined-scan-results-provider.ts
38 8 1
public async handleRequest()
in packages/web-api/src/controllers/scan-request-controller.ts
37 3 0
public async upsertItems()
in packages/azure-services/src/azure-cosmos/cosmos-client-wrapper.ts
36 3 5
function getScanArguments()
in packages/service-library/src/dev-utilities/load-test.ts
36 1 0
public async getFailedTasks()
in packages/azure-services/src/azure-batch/batch.ts
35 5 1