microsoft / tsiclient
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 645 units with 10,430 lines of code in units (48.4% of code).
    • 10 very long units (1,517 lines of code)
    • 26 long units (1,911 lines of code)
    • 100 medium size units (3,161 lines of code)
    • 127 small units (1,868 lines of code)
    • 382 very small units (1,973 lines of code)
14% | 18% | 30% | 17% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts15% | 19% | 28% | 17% | 18%
js0% | 9% | 50% | 20% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/UXClient/Components20% | 20% | 26% | 15% | 15%
src/UXClient/Models12% | 13% | 33% | 22% | 18%
src/UXClient/Utils0% | 14% | 29% | 27% | 27%
src/packages/pikaday0% | 9% | 50% | 20% | 19%
src/UXClient/Interfaces0% | 18% | 16% | 24% | 40%
src/UXClient0% | 42% | 44% | 8% | 3%
src/ServerClient0% | 0% | 58% | 3% | 38%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public render()
in src/UXClient/Components/LinePlot/LinePlot.ts
263 50 24
public async render()
in src/UXClient/Components/HierarchyNavigation/HierarchyNavigation.ts
187 32 3
public render()
in src/UXClient/Components/ModelSearch/ModelSearch.ts
159 30 4
public render()
in src/UXClient/Components/PieChart/PieChart.ts
155 24 3
public draw()
in src/UXClient/Components/Legend/Legend.ts
153 26 7
public mergeDataToDisplayStateAndTimeArrays()
in src/UXClient/Models/ChartComponentData.ts
142 51 2
private createHierarchyItemElem()
in src/UXClient/Components/HierarchyNavigation/HierarchyNavigation.ts
126 26 2
public render()
in src/UXClient/Components/AvailabilityChart/AvailabilityChart.ts
123 28 3
private renderMarker()
in src/UXClient/Components/Marker/Marker.ts
108 11 0
public render()
in src/UXClient/Components/HeatmapCanvas/HeatmapCanvas.ts
101 19 8
private brushEnd()
in src/UXClient/Components/LineChart/LineChart.ts
100 38 1
public render()
in src/UXClient/Components/ScatterPlot/ScatterPlot.ts
100 14 4
public render()
in src/UXClient/Components/Heatmap/Heatmap.ts
95 18 3
public render()
in src/UXClient/Components/Hierarchy/Hierarchy.ts
88 13 2
public toObject()
in src/UXClient/Models/ChartOptions.ts
87 1 0
render: function()
in src/packages/pikaday/pikaday.js
86 29 3
protected tooltipFormat()
in src/UXClient/Interfaces/ChartComponent.ts
82 18 4
public renderLegend()
in src/UXClient/Components/EventsTable/EventsTable.ts
81 9 0
private renderTree()
in src/UXClient/Components/HierarchyNavigation/HierarchyNavigation.ts
80 25 4
private renderScale()
in src/UXClient/Components/HeatmapCanvas/HeatmapCanvas.ts
78 22 0