aws-cloudformation / cfn-lint-visual-studio-code
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 22 units with 424 lines of code in units (71.3% of code).
    • 1 very long units (129 lines of code)
    • 1 long units (81 lines of code)
    • 3 medium size units (69 lines of code)
    • 5 small units (74 lines of code)
    • 12 very small units (71 lines of code)
30% | 19% | 16% | 17% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts30% | 19% | 16% | 17% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
server/src82% | 0% | 0% | 17% | 0%
client/src0% | 54% | 32% | 12% | 0%
client/src/yaml-support0% | 0% | 17% | 22% | 59%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function runLinter()
in server/src/server.ts
129 12 1
export function activate()
in client/src/extension.ts
81 4 1
function reloadSidePreview()
in client/src/extension.ts
27 3 2
function requestYamlSchemaUriCallback()
in client/src/yaml-support/yaml-schema.ts
21 6 1
21 8 0
function getPreviewContent()
in client/src/extension.ts
19 1 1
function isCloudFormation()
in server/src/server.ts
17 6 2
async function activateYamlExtension()
in client/src/yaml-support/yaml-schema.ts
16 6 0
private ensureCache()
in client/src/yaml-support/yaml-locator.ts
11 3 2
function convertSeverity()
in server/src/server.ts
11 4 1
function requestYamlSchemaContentCallback()
in client/src/yaml-support/yaml-schema.ts
10 4 1
export function getYamlMappingValue()
in client/src/yaml-support/yaml-util.ts
9 5 3
export function getYamlMappingNode()
in client/src/yaml-support/yaml-util.ts
9 5 3
export function loadJson()
in client/src/yaml-support/yaml-util.ts
9 3 1
export async function registerYamlSchemaSupport()
in client/src/yaml-support/yaml-schema.ts
8 3 0
public getMatchedElement()
in client/src/yaml-support/yaml-locator.ts
6 1 2
public getYamlDocuments()
in client/src/yaml-support/yaml-locator.ts
5 1 1
public loadSchemaFromRaw()
in client/src/yaml-support/schema-holder.ts
3 1 0
export function equalIgnoreCase()
in client/src/yaml-support/yaml-util.ts
3 3 2
export function isMapping()
in client/src/yaml-support/yaml-locator.ts
3 1 1