microsoft / vscode-pull-request-github
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 965 units with 15,964 lines of code in units (64.4% of code).
    • 10 very long units (1,887 lines of code)
    • 40 long units (2,639 lines of code)
    • 161 medium size units (5,031 lines of code)
    • 259 small units (3,821 lines of code)
    • 495 very small units (2,586 lines of code)
11% | 16% | 31% | 23% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts10% | 16% | 31% | 24% | 16%
tsx35% | 16% | 25% | 12% | 10%
js0% | 0% | 0% | 75% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src72% | 0% | 5% | 13% | 9%
src/issues14% | 23% | 37% | 14% | 11%
src/github5% | 15% | 34% | 29% | 15%
webviews/components42% | 9% | 30% | 12% | 4%
src/view3% | 26% | 31% | 22% | 16%
webviews/createPullRequestView0% | 71% | 0% | 0% | 28%
src/common0% | 5% | 33% | 33% | 27%
src/gitProviders0% | 0% | 28% | 35% | 35%
src/authentication0% | 0% | 90% | 0% | 9%
src/integrations0% | 0% | 48% | 0% | 52%
webviews/common0% | 0% | 0% | 39% | 60%
scripts0% | 0% | 0% | 75% | 25%
src/env0% | 0% | 0% | 50% | 50%
src/api0% | 0% | 0% | 31% | 68%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
636 82 7
async initialize()
in src/issues/issueFeatureRegistrar.ts
254 2 0
provideCompletionItems: async()
in src/github/folderRepositoryManager.ts
154 37 3
export default function Sidebar()
in webviews/components/sidebar.tsx
144 14 6
private async validateState()
in src/view/reviewManager.ts
134 27 2
async function init()
in src/extension.ts
131 21 7
export function AddComment()
in webviews/components/comment.tsx
115 18 7
async provideCompletionItems()
in src/issues/issueCompletionProvider.ts
112 32 4
private async deleteBranch()
in src/github/activityBarViewProvider.ts
105 18 1
private async deleteBranch()
in src/github/pullRequestOverview.ts
102 19 1
private async provideDocumentContent()
in src/view/treeNodes/pullRequestNode.ts
100 31 1
public async updatePullRequest()
in src/github/pullRequestOverview.ts
95 7 1
private async registerListeners()
in src/view/reviewCommentController.ts
93 15 0
public async updatePullRequest()
in src/github/activityBarViewProvider.ts
89 9 1
public async publishBranch()
in src/view/reviewManager.ts
88 17 1
79 19 3
private async getBranchDeletionItems()
in src/github/folderRepositoryManager.ts
78 17 0
private async resolveFileChanges()
in src/view/treeNodes/pullRequestNode.ts
76 5 0
private async doCreateIssue()
in src/issues/issueFeatureRegistrar.ts
75 16 9
async createIssueFromFile()
in src/issues/issueFeatureRegistrar.ts
74 15 0