pytorch / pytorch_sphinx_theme
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 91 units with 909 lines of code in units (7.1% of code).
    • 1 very long units (148 lines of code)
    • 1 long units (55 lines of code)
    • 5 medium size units (145 lines of code)
    • 17 small units (226 lines of code)
    • 67 very small units (335 lines of code)
16% | 6% | 15% | 24% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js16% | 6% | 16% | 25% | 36%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT96% | 0% | 0% | 0% | 3%
js0% | 7% | 19% | 30% | 43%
pytorch_sphinx_theme0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
148 3 1
bind: function()
in js/side-menus.js
55 15 0
handleRightMenu: function()
in js/side-menus.js
40 5 0
highlight: function()
in js/highlight-navigation.js
30 9 0
28 6 0
throttle: function()
in js/_utilities.js
25 9 3
jQuery()
in js/theme.js
22 5 1
closest: function()
in js/_utilities.js
19 5 2
18 6 1
nav.init = function()
in js/theme.js
17 1 1
scrollIfAnchor: function()
in js/scroll-to-anchor.js
15 5 2
function ThemeNav()
in js/theme.js
14 1 0
offset: function()
in js/_utilities.js
14 5 1
function updateList()
in js/filter-tutorial-tags.js
13 3 0
$()
in js/filter-tutorial-tags.js
13 3 1
function toggleDropdown()
in js/main-menu-dropdown.js
12 2 1
12 2 0
$()
in js/theme.js
12 8 1
$()
in js/theme.js
12 5 1
bind: function()
in js/highlight-navigation.js
11 3 0