bazelbuild / vscode-bazel
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 145 units with 2,041 lines of code in units (51.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (74 lines of code)
    • 39 medium size units (1,135 lines of code)
    • 29 small units (425 lines of code)
    • 76 very small units (407 lines of code)
0% | 3% | 55% | 20% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 3% | 55% | 20% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
extension0% | 24% | 36% | 22% | 15%
buildifier0% | 0% | 83% | 12% | 4%
debug-adapter0% | 0% | 52% | 18% | 29%
bazel0% | 0% | 51% | 28% | 19%
workspace-tree0% | 0% | 48% | 18% | 32%
codelens0% | 0% | 82% | 0% | 17%
completion-provider0% | 0% | 37% | 42% | 19%
definition0% | 0% | 100% | 0% | 0%
symbols0% | 0% | 60% | 39% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function activate()
in src/extension/extension.ts
74 1 1
export function exitCodeToUserString()
in src/bazel/bazel_exit_code.ts
45 18 1
export function parseExitCode()
in src/bazel/bazel_exit_code.ts
44 20 2
protected async variablesRequest()
in src/debug-adapter/client.ts
42 6 2
40 7 2
protected setBreakPointsRequest()
in src/debug-adapter/client.ts
38 3 2
private run()
in src/bazel/bazel_query.ts
36 4 1
export async function buildifierLint()
in src/buildifier/buildifier.ts
35 5 3
34 3 1
private buildPackageTree()
in src/workspace-tree/bazel_workspace_folder_tree_item.ts
33 4 5
public provideCompletionItems()
in src/completion-provider/bazel_completion_provider.ts
33 6 2
private computeCodeLenses()
in src/codelens/bazel_build_code_lens_provider.ts
33 4 2
public async provideDocumentFormattingEdits()
in src/buildifier/buildifier_format_provider.ts
32 3 3
private async getDirectoryItems()
in src/workspace-tree/bazel_workspace_folder_tree_item.ts
31 2 0
protected async launchRequest()
in src/debug-adapter/client.ts
31 3 2
protected async stackTraceRequest()
in src/debug-adapter/client.ts
31 5 2
private getBazelInfo()
in src/debug-adapter/client.ts
31 3 2
export async function buildifierLint()
in src/buildifier/buildifier.ts
30 5 3
public async updateDiagnostics()
in src/buildifier/buildifier_diagnostics_manager.ts
28 2 1
function executeBuildifier()
in src/buildifier/buildifier.ts
28 4 3