microsoft / vscode-java-pack
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 242 units with 3,419 lines of code in units (45.4% of code).
    • 3 very long units (561 lines of code)
    • 6 long units (445 lines of code)
    • 30 medium size units (891 lines of code)
    • 43 small units (649 lines of code)
    • 160 very small units (873 lines of code)
16% | 13% | 26% | 18% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts17% | 14% | 23% | 19% | 25%
tsx0% | 0% | 65% | 12% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/ext-guide71% | 0% | 7% | 7% | 13%
src/overview58% | 0% | 14% | 8% | 19%
src/java-runtime19% | 13% | 16% | 32% | 17%
src/formatter-settings0% | 47% | 22% | 12% | 17%
src/welcome0% | 0% | 61% | 9% | 29%
src/classpath0% | 0% | 50% | 20% | 29%
src/install-jdk0% | 0% | 33% | 35% | 31%
src/commands0% | 0% | 41% | 14% | 43%
src0% | 0% | 56% | 0% | 43%
src/beginner-tips0% | 0% | 31% | 31% | 37%
src/utils0% | 0% | 11% | 33% | 54%
src/recommendation0% | 0% | 0% | 51% | 48%
src/misc0% | 0% | 0% | 100% | 0%
src/exp0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function getHtmlForWebview()
in src/ext-guide/index.ts
252 12 1
function getHtmlForWebview()
in src/overview/index.ts
203 12 1
async function initializeJavaRuntimeView()
in src/java-runtime/index.ts
106 17 3
export function parseProfile()
in src/formatter-settings/utils.ts
88 23 1
export function profile2WebViewConvert()
in src/formatter-settings/FormatterConverter.ts
81 61 2
export function getDefaultValue()
in src/formatter-settings/FormatterConstants.ts
73 57 1
public async resolveCustomTextEditor()
in src/formatter-settings/index.ts
73 18 3
export async function resolveRequirements()
in src/java-runtime/utils/upstreamApi.ts
73 17 0
export function webView2ProfileConvert()
in src/formatter-settings/FormatterConverter.ts
57 38 2
async function initializeWebview()
in src/classpath/classpathConfigurationView.ts
44 10 1
async function checkRequirement()
in src/classpath/classpathConfigurationView.ts
42 6 0
async function getProjectClasspathFromLS()
in src/classpath/classpathConfigurationView.ts
42 8 1
39 7 0
private constructor()
in src/install-jdk/index.ts
36 6 2
renderWelcomePage()
in src/welcome/assets/components/GetStartedPage.tsx
36 1 0
render()
in src/welcome/assets/components/QuickActionPanel.tsx
36 2 0
render()
in src/welcome/assets/components/NavigationPanel.tsx
34 5 0
function replace()
in src/formatter-settings/assets/whitespace.ts
33 11 1
31 5 2
31 6 3