microsoft / vscode-python
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 2,395 units with 26,698 lines of code in units (67.7% of code).
    • 8 very long units (1,170 lines of code)
    • 43 long units (3,075 lines of code)
    • 262 medium size units (7,533 lines of code)
    • 479 small units (7,046 lines of code)
    • 1,603 very small units (7,874 lines of code)
4% | 11% | 28% | 26% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts3% | 12% | 28% | 26% | 28%
py13% | 0% | 11% | 23% | 50%
js0% | 0% | 73% | 11% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/client3% | 12% | 28% | 26% | 28%
pythonFiles36% | 0% | 6% | 22% | 33%
ROOT0% | 0% | 72% | 13% | 13%
pythonFiles/testing_tools0% | 0% | 21% | 29% | 49%
build/ci0% | 0% | 93% | 0% | 6%
news0% | 0% | 20% | 55% | 23%
src/testMultiRootWkspc0% | 0% | 0% | 0% | 100%
build0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected update()
in src/client/common/configSettings.ts
240 34 1
private async runTest()
in src/client/testing/testController/unittest/runner.ts
231 46 5
def main()
in pythonFiles/visualstudio_py_testlauncher.py
167 23 0
function pytestFilterArguments()
in src/client/testing/testController/pytest/arguments.ts
112 11 2
public async install()
in src/client/common/installer/productInstaller.ts
108 19 4
export function registerTypes()
in src/client/common/serviceRegistry.ts
107 1 1
label: localize()
in src/client/common/utils/localize.ts
103 1 2
detail: localize()
in src/client/common/utils/localize.ts
102 1 2
openButtonLabel: localize()
in src/client/common/utils/localize.ts
98 1 2
export function registerTypes()
in src/client/debugger/extension/serviceRegistry.ts
98 1 1
title: localize()
in src/client/common/utils/localize.ts
97 1 2
public async refreshTestData()
in src/client/testing/testController/unittest/unittestController.ts
97 17 3
protected async provideLaunchDefaults()
in src/client/debugger/extension/configuration/resolvers/launch.ts
95 38 2
await updateTestItemFromRawData()
in src/client/testing/testController/pytest/pytestController.ts
91 14 6
public async refreshTestData()
in src/client/testing/testController/pytest/pytestController.ts
91 14 3
public async getActivatedEnvironmentVariablesImpl()
in src/client/interpreter/activation/service.ts
90 25 3
export async function updateResultFromJunitXml()
in src/client/testing/testController/common/resultsHelper.ts
88 17 4
private async ensurePrerequisitesAreInstalled()
in src/client/tensorBoard/tensorBoardSession.ts
87 19 0
name: localize()
in src/client/common/utils/localize.ts
83 1 2
async function updateTestItemFromRawDataInternal()
in src/client/testing/testController/common/testItemUtilities.ts
83 20 6