facebookresearch / hiplot
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 332 units with 4,015 lines of code in units (62.7% of code).
    • 1 very long units (120 lines of code)
    • 7 long units (453 lines of code)
    • 39 medium size units (1,206 lines of code)
    • 69 small units (1,056 lines of code)
    • 216 very small units (1,180 lines of code)
2% | 11% | 30% | 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
tsx5% | 14% | 37% | 20% | 23%
py0% | 12% | 7% | 38% | 41%
ts0% | 0% | 34% | 30% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/parallel20% | 22% | 32% | 16% | 7%
src0% | 10% | 44% | 17% | 28%
hiplot0% | 12% | 7% | 38% | 41%
src/streamlit0% | 81% | 0% | 0% | 18%
src/distribution0% | 0% | 59% | 28% | 12%
src/lib0% | 0% | 18% | 35% | 46%
src/tutorial0% | 0% | 21% | 61% | 17%
src/dataproviders0% | 0% | 0% | 22% | 77%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function brush()
in src/parallel/parallel.tsx
120 21 0
mountDt()
in src/rowsdisplaytable.tsx
92 16 0
componentDidUpdate()
in src/parallel/parallel.tsx
73 27 2
def demo()
in hiplot/fetchers_demo.py
61 13 1
59 6 1
function create_drag_beh()
in src/parallel/parallel.tsx
59 6 0
export function withStreamlitConnection()
in src/streamlit/StreamlitReact.tsx
58 3 1
def load_fairseq()
in hiplot/fetchers.py
51 19 1
50 8 0
columnContextMenu()
in src/component.tsx
45 3 2
drawHistogramRects()
in src/distribution/plot.tsx
44 6 4
renderControls()
in src/header.tsx
42 7 0
def html_inlinize()
in hiplot/render.py
41 14 2
render()
in src/component.tsx
41 5 0
function infertype()
in src/infertypes.ts
41 18 2
drawAllHistograms()
in src/distribution/plot.tsx
40 4 1
initParallelPlot()
in src/parallel/parallel.tsx
37 1 1
function redraw_axis()
in src/parallel/parallel.tsx
37 2 0
render()
in src/tutorial/tutorial.tsx
37 3 0
37 10 3