microsoft / vscode-cosmosdb
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 760 units with 7,286 lines of code in units (45.4% of code).
    • 2 very long units (382 lines of code)
    • 12 long units (688 lines of code)
    • 63 medium size units (1,958 lines of code)
    • 117 small units (1,754 lines of code)
    • 566 very small units (2,504 lines of code)
5% | 9% | 26% | 24% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts5% | 9% | 27% | 23% | 34%
js0% | 0% | 0% | 42% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/mongo10% | 14% | 27% | 18% | 28%
src/commands0% | 24% | 35% | 26% | 13%
src0% | 28% | 0% | 32% | 39%
src/tree0% | 0% | 58% | 12% | 29%
src/postgres0% | 0% | 22% | 36% | 40%
src/docdb0% | 0% | 14% | 29% | 56%
src/utils0% | 0% | 20% | 31% | 47%
src/graph0% | 0% | 23% | 24% | 51%
build0% | 0% | 0% | 50% | 50%
ROOT0% | 0% | 0% | 0% | 100%
src/table0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private getAggregateStagePropertiesSchema()
in src/mongo/services/schemaService.ts
214 1 1
private setOperatorProperties()
in src/mongo/services/schemaService.ts
168 3 2
80 13 2
public command()
in src/mongo/grammar/mongoParser.ts
63 6 0
export function registerMongoCommands()
in src/mongo/registerMongoCommands.ts
61 8 0
public commands()
in src/mongo/grammar/mongoParser.ts
58 9 0
public literal()
in src/mongo/grammar/mongoParser.ts
58 11 0
public propertyValue()
in src/mongo/grammar/mongoParser.ts
57 11 0
private createDbFunctionCompletions()
in src/mongo/services/completionItemProvider.ts
53 1 1
private createCollectionFunctionsCompletions()
in src/mongo/services/completionItemProvider.ts
53 1 1
public arguments()
in src/mongo/grammar/mongoParser.ts
52 6 0
export async function findTreeItem()
in src/commands/api/findTreeItem.ts
51 12 1
export async function pickTreeItem()
in src/commands/api/pickTreeItem.ts
51 12 1
async function executeCommand()
in src/mongo/MongoScrapbook.ts
51 13 3
public argument()
in src/mongo/grammar/mongoParser.ts
50 10 0
private async startCore()
in src/utils/InteractiveChildProcess.ts
50 10 0
private async _determineShellPathOrCmd()
in src/mongo/tree/MongoDatabaseTreeItem.ts
48 11 2
async function searchDbAccounts()
in src/commands/api/findTreeItem.ts
47 18 4
public async executeScript()
in src/mongo/MongoShell.ts
47 6 1
export async function importDocuments()
in src/commands/importDocuments.ts
45 6 3