angular / angular-cli
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 1,454 units with 21,402 lines of code in units (44.5% of code).
    • 14 very long units (2,091 lines of code)
    • 58 long units (4,038 lines of code)
    • 225 medium size units (7,038 lines of code)
    • 266 small units (3,952 lines of code)
    • 891 very small units (4,283 lines of code)
9% | 18% | 32% | 18% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts9% | 19% | 32% | 18% | 20%
js0% | 0% | 60% | 30% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/angular23% | 14% | 36% | 16% | 9%
packages/angular_devkit7% | 19% | 27% | 18% | 26%
packages/schematics0% | 28% | 44% | 12% | 14%
scripts0% | 12% | 42% | 38% | 6%
tools0% | 0% | 60% | 27% | 11%
lib0% | 0% | 68% | 0% | 31%
packages0% | 0% | 100% | 0% | 0%
goldens/public-api0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async run()
in packages/angular/cli/commands/update-impl.ts
382 102 1
async run()
in packages/angular/cli/commands/add-impl.ts
167 40 1
function create()
in packages/angular_devkit/core/src/workspace/json/utilities.ts
162 56 4
private _createJob()
in packages/angular_devkit/core/src/experimental/jobs/simple-scheduler.ts
158 16 5
public override async initialize()
in packages/angular/cli/models/architect-command.ts
154 44 1
export async function main()
in packages/angular_devkit/benchmark/src/main.ts
147 25 4
function updateJsonWorkspace()
in packages/angular_devkit/core/src/workspace/json/writer.ts
130 39 1
async function setup()
in packages/angular_devkit/build_angular/src/builders/dev-server/index.ts
127 29 0
protected async runSchematic()
in packages/angular/cli/models/schematic-command.ts
117 29 1
function visitor()
in packages/angular/cli/utilities/json-schema.ts
116 48 3
export async function augmentIndexHtml()
in packages/angular_devkit/build_angular/src/utils/index-file/augment-index-html.ts
113 32 1
protected async createWorkflow()
in packages/angular/cli/models/schematic-command.ts
110 21 1
usePromptProvider()
in packages/angular_devkit/core/src/json/schema/registry.ts
104 27 1
async run()
in packages/angular/cli/commands/version-impl.ts
104 16 0
function _usageMessage()
in packages/angular/cli/src/commands/update/schematic/index.ts
100 24 3
VariableDeclaration()
in packages/angular_devkit/build_angular/src/babel/plugins/adjust-typescript-enums.ts
99 24 2
function parseProject()
in packages/angular_devkit/core/src/workspace/json/reader.ts
98 20 3
function addAppToWorkspaceFile()
in packages/schematics/angular/application/index.ts
94 18 3
export function parseArguments()
in packages/angular/cli/models/parser.ts
92 26 3
private async _compile()
in packages/angular_devkit/core/src/json/schema/registry.ts
89 15 1