awslabs / swagger-ui
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 174 units with 2,289 lines of code in units (14.7% of code).
    • 3 very long units (416 lines of code)
    • 3 long units (224 lines of code)
    • 14 medium size units (387 lines of code)
    • 42 small units (611 lines of code)
    • 112 very small units (651 lines of code)
18% | 9% | 16% | 26% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js18% | 9% | 16% | 26% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/core18% | 10% | 14% | 27% | 28%
src/helpers0% | 0% | 92% | 0% | 7%
docker/configurator0% | 0% | 100% | 0% | 0%
src/plugins0% | 0% | 0% | 0% | 100%
swagger-ui-dist-package0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
160 83 5
155 24 1
export default function()
in src/core/presets/base.js
101 1 0
export default function authorize()
in src/core/oauth2-authorize.js
97 26 6
export default function()
in src/core/plugins/err/reducers.js
69 11 0
function systemExtend()
in src/core/system.js
58 28 2
export default function downloadUrlPlugin()
in src/core/plugins/download-url.js
48 7 1
export default function getParameterSchema()
in src/helpers/get-parameter-schema.js
38 5 2
function objectToKeyValueString()
in docker/configurator/translator.js
34 10 4
function checkPossibleFailReasons()
in src/core/plugins/download-url.js
28 6 0
getWrappedAndBoundSelectors()
in src/core/system.js
28 6 2
getWrappedAndBoundActions()
in src/core/system.js
27 6 1
27 7 1
function createTailoredParameterError()
in src/core/plugins/err/error-transformers/transformers/parameter-oneof.js
25 8 2
function makeWindow()
in src/core/window.js
23 5 0
export function mapToList()
in src/core/utils.js
23 7 3
export default function()
in src/core/plugins/on-complete/index.js
22 3 0
getBoundActions()
in src/core/system.js
22 4 1
export default function transformErrors()
in src/core/plugins/err/error-transformers/hook.js
21 4 1
21 4 1