cdklabs / awscdk-change-analyzer
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 376 units with 3,846 lines of code in units (51.1% of code).
    • 1 very long units (110 lines of code)
    • 4 long units (266 lines of code)
    • 33 medium size units (948 lines of code)
    • 77 small units (1,142 lines of code)
    • 261 very small units (1,380 lines of code)
2% | 6% | 24% | 29% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts3% | 3% | 22% | 30% | 39%
tsx0% | 32% | 41% | 21% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/@aws-c2a/cdk-pipelines-step39% | 0% | 43% | 10% | 7%
packages/@aws-c2a/visualizer0% | 100% | 0% | 0% | 0%
packages/@aws-c2a/engine0% | 5% | 32% | 36% | 25%
packages/@aws-c2a/web-app0% | 13% | 45% | 26% | 14%
packages/@aws-c2a/presets0% | 29% | 11% | 25% | 34%
packages/aws-c2a/lib0% | 0% | 27% | 34% | 37%
packages/@aws-c2a/models0% | 0% | 0% | 28% | 71%
packages/@aws-c2a/rules0% | 0% | 0% | 26% | 73%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in packages/@aws-c2a/cdk-pipelines-step/lib/private/change-analysis-check.ts
110 2 3
export default function App()
in packages/@aws-c2a/visualizer/src/App.tsx
76 5 2
private fromRecordProperties()
in packages/@aws-c2a/engine/lib/model-diffing/property-diff.ts
69 3 4
export default function ChangeDetailsPane()
in packages/@aws-c2a/web-app/src/AggregationsView/ChangeDetailsPane/ChangeDetailsPane.tsx
65 9 1
public static BroadeningPermissions()
in packages/@aws-c2a/presets/lib/iam-changes.ts
56 1 0
export default function ChangeTree()
in packages/@aws-c2a/web-app/src/AggregationsView/ChangeTree/index.tsx
49 4 0
export function resolveCfnProperty()
in packages/aws-c2a/lib/private/cfn.ts
46 8 2
export default function App()
in packages/@aws-c2a/web-app/src/App.tsx
44 2 1
private evaluateReport()
in packages/aws-c2a/lib/toolkit.ts
43 7 2
public produceAction()
in packages/@aws-c2a/cdk-pipelines-step/lib/perform-change-analysis.ts
40 4 2
export default function ComponentPropertyDiff()
in packages/@aws-c2a/web-app/src/reusable-components/ComponentPropertyDiff.tsx
37 5 2
private fromDifferentProperties()
in packages/@aws-c2a/engine/lib/model-diffing/property-diff.ts
36 5 4
constructor()
in packages/@aws-c2a/cdk-pipelines-step/lib/private/web-app-bucket.ts
32 1 3
function propagatePropertyOperation()
in packages/@aws-c2a/engine/lib/model-diffing/change-propagator.ts
31 10 2
export function matchEntities()
in packages/@aws-c2a/engine/lib/model-diffing/entity-matchers/entities-matcher.ts
31 5 4
function findMatchesDecreasingSimilarity()
in packages/@aws-c2a/engine/lib/model-diffing/entity-matchers/entities-matcher.ts
30 8 4
function propagateReplacementOperation()
in packages/@aws-c2a/engine/lib/model-diffing/change-propagator.ts
29 5 2
private buildDiffString()
in packages/@aws-c2a/web-app/src/selectors/diff-stringifier.ts
28 6 3
private static findAggsIntersections()
in packages/@aws-c2a/engine/lib/aggregations/aggregations-extractor.ts
28 7 1
public processMetadataMessages()
in packages/aws-c2a/lib/cloud-assembly.ts
27 10 1