apple / swift-docc-render
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 186 units with 1,567 lines of code in units (7.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 12 medium size units (316 lines of code)
    • 40 small units (564 lines of code)
    • 134 very small units (687 lines of code)
0% | 0% | 20% | 35% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 21% | 34% | 44%
py0% | 0% | 0% | 65% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/utils0% | 0% | 22% | 37% | 40%
src/mixins0% | 0% | 25% | 32% | 42%
src/setup-utils0% | 0% | 37% | 50% | 11%
ROOT0% | 0% | 0% | 55% | 44%
src/plugins0% | 0% | 0% | 15% | 84%
src/stores0% | 0% | 0% | 12% | 87%
src/directives0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
getOptionsForDiffAvailabilities()
in src/mixins/apiChangesHelpers.js
34 7 1
function indentSwiftDeclaration()
in src/utils/indentation.js
33 9 1
function baseChainWebpack()
in src/setup-utils/vue-config-utils.js
32 2 1
async handler()
in src/mixins/apiChangesObserving.js
29 11 2
export default function createRouterInstance()
in src/setup-utils/SwiftDocCRenderRouter.js
26 4 1
function remove()
in src/utils/json-patch.js
26 6 2
25 2 2
function add()
in src/utils/json-patch.js
24 5 3
async function importHighlightFileForLanguage()
in src/utils/syntax-highlight.js
23 3 1
export function pluralize()
in src/utils/strings.js
22 9 2
21 5 3
21 5 1
export async function scrollBehavior()
in src/utils/router-utils.js
20 7 3
def ensure_npm_is_installed()
in build-script-helper.py
19 3 1
export default function()
in src/utils/custom-highlight-lang/swift.js
18 2 1
function isEqual()
in src/utils/json-patch.js
18 5 2
onFocus()
in src/utils/FocusTrap.js
17 5 1
export default function debounce()
in src/utils/debounce.js
17 5 4
function indentObjcDeclaration()
in src/utils/indentation.js
17 4 1
export function sanitizeMultilineNodes()
in src/utils/syntax-highlight.js
17 5 1