aws / aws-toolkit-vscode
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,818 units with 30,985 lines of code in units (75.4% of code).
    • 5 very long units (699 lines of code)
    • 54 long units (3,431 lines of code)
    • 311 medium size units (9,235 lines of code)
    • 555 small units (8,046 lines of code)
    • 1,893 very small units (9,574 lines of code)
2% | 11% | 29% | 25% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts2% | 11% | 29% | 25% | 30%
js0% | 0% | 32% | 17% | 50%
java0% | 0% | 0% | 75% | 25%
go0% | 0% | 0% | 86% | 13%
cs0% | 0% | 0% | 68% | 31%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/shared3% | 10% | 27% | 26% | 32%
src43% | 0% | 6% | 24% | 25%
src/lambda3% | 11% | 31% | 30% | 23%
src/eventSchemas0% | 23% | 30% | 21% | 25%
src/dynamicResources0% | 33% | 29% | 18% | 18%
src/stepFunctions0% | 13% | 29% | 22% | 34%
src/ssmDocument0% | 19% | 36% | 15% | 28%
src/s30% | 13% | 28% | 28% | 29%
src/awsexplorer0% | 26% | 30% | 17% | 25%
src/iot0% | 8% | 33% | 27% | 30%
src/ecs0% | 11% | 28% | 27% | 32%
src/cloudWatchLogs0% | 11% | 33% | 20% | 34%
src/apigateway0% | 14% | 35% | 25% | 24%
src/credentials0% | 0% | 36% | 26% | 37%
src/apprunner0% | 0% | 24% | 31% | 43%
src/webviews0% | 0% | 65% | 15% | 19%
src/cdk0% | 0% | 45% | 21% | 32%
media/js0% | 0% | 35% | 18% | 46%
src/ecr0% | 0% | 37% | 25% | 36%
build-scripts0% | 0% | 18% | 35% | 46%
src/feedback0% | 0% | 78% | 0% | 21%
src/integrationTest0% | 0% | 68% | 0% | 31%
src/testFixtures0% | 0% | 0% | 63% | 36%
test-scripts0% | 0% | 0% | 41% | 58%
resources/debugger0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public async makeConfig()
in src/shared/sam/debugger/awsSamDebugger.ts
197 33 3
165 5 0
export function getResourcesForHandlerFromTemplateDatum()
in src/shared/cloudformation/templateRegistry.ts
121 26 3
export async function createNewSamApplication()
in src/lambda/commands/createNewSamApp.ts
114 10 2
async function invokeLambdaHandler()
in src/shared/sam/localLambdaRunner.ts
102 9 3
export async function uploadFileCommand()
in src/s3/commands/uploadFile.ts
92 12 6
export async function updateResource()
in src/dynamicResources/commands/saveResource.ts
91 4 5
public async run()
in src/shared/utilities/childProcess.ts
87 17 1
export async function installCli()
in src/shared/utilities/cliUtils.ts
85 13 3
Header: getPageHeader()
in src/eventSchemas/commands/searchSchemas.ts
83 7 1
SearchInputPlaceholder: localize()
in src/eventSchemas/commands/searchSchemas.ts
82 7 2
async function registerAwsExplorerCommands()
in src/awsexplorer/activation.ts
81 4 3
76 11 3
async function activateCodeLensProviders()
in src/shared/sam/activation.ts
76 4 4
public async promptUserForParametersIfApplicable()
in src/lambda/wizards/samDeployWizard.ts
75 8 2
export async function makePythonDebugConfig()
in src/shared/sam/debugger/pythonSamDebug.ts
73 11 1
public async showInputBox()
in src/shared/multiStepInputFlowController.ts
72 12 10
export async function deleteCertCommand()
in src/iot/commands/deleteCert.ts
71 7 2
export async function activate()
in src/dynamicResources/activation.ts
71 7 1
export async function makeCodeLenses()
in src/shared/codelens/codeLensUtils.ts
70 13 5