microsoft / vsts-extension-samples
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 350 units with 3,213 lines of code in units (44.5% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (145 lines of code)
    • 29 medium size units (818 lines of code)
    • 67 small units (988 lines of code)
    • 252 very small units (1,262 lines of code)
0% | 4% | 25% | 30% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 7% | 26% | 28% | 38%
js0% | 0% | 25% | 34% | 39%
tsx0% | 0% | 21% | 35% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backlogs-panel0% | 56% | 22% | 4% | 16%
analytics-example-widget0% | 0% | 19% | 34% | 46%
data-storage0% | 0% | 27% | 34% | 37%
build-inspector0% | 0% | 35% | 29% | 34%
ui0% | 0% | 45% | 16% | 37%
ui-fabric-react0% | 0% | 52% | 13% | 33%
widgets0% | 0% | 31% | 37% | 31%
dashboard-manager0% | 0% | 0% | 52% | 47%
build-results-enhancer0% | 0% | 0% | 44% | 55%
contributions-guide0% | 0% | 0% | 65% | 34%
release-management0% | 0% | 0% | 52% | 47%
custom-content-renderer0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private static _computePullRequestState()
in backlogs-panel/src/workdetailsdata.ts
77 17 1
public static beginGetWorkDetails()
in backlogs-panel/src/workdetailsdata.ts
68 9 3
export function publishEvent()
in data-storage/src/dataStorage/notesNotificationUtils.ts
44 2 2
private _renderTree()
in build-inspector/src/inspector/associatedItemsView.ts
35 3 0
public updateNote()
in data-storage/src/dataStorage/notesServices.ts
35 9 3
public render()
in ui-fabric-react/scripts/WorkItemSearchComponent.tsx
35 5 0
public initialize()
in data-storage/src/dataStorage/notesDialogs.ts
34 2 0
private addFilterRowImpl()
in analytics-example-widget/scripts/config/AnalyticsConfigActionCreator.ts
33 3 1
public begingetResult()
in ui-fabric-react/scripts/WorkItemSearch.ts
32 3 1
var getQueryInfo = function()
in widgets/templates/scripts/Widget-for-sample-configuration.js
32 9 1
public requestData()
in analytics-example-widget/scripts/widget/AnalyticsViewActionCreator.ts
31 3 0
public render()
in backlogs-panel/src/components/devdetails.tsx
31 3 0
private buildWiql()
in ui-fabric-react/scripts/WorkItemSearch.ts
31 7 1
public runQuery()
in analytics-example-widget/scripts/data/ViewQueries.ts
30 4 0
constructor()
in analytics-example-widget/scripts/config/AnalyticsConfigActionCreator.ts
29 2 3
getMenuItems: function()
in ui/menu/scripts/contributedItems.js
29 2 1
public runQuery()
in analytics-example-widget/scripts/data/PopularValueQuery.ts
27 2 0
public setWorkItemIds()
in backlogs-panel/src/main.tsx
27 6 1
public initialize()
in build-inspector/src/inspector/associatedItemsGrid.ts
27 2 0
load: function()
in widgets/templates/scripts/sample-configuration.js
27 7 2