awslabs / swagger-ui
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 174 units with 2,289 lines of code in units (14.7% of code).
    • 1 very complex units (160 lines of code)
    • 2 complex units (155 lines of code)
    • 3 medium complex units (240 lines of code)
    • 18 simple units (398 lines of code)
    • 150 very simple units (1,336 lines of code)
6% | 6% | 10% | 17% | 58%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
js6% | 6% | 10% | 17% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/core7% | 7% | 10% | 16% | 58%
docker/configurator0% | 0% | 0% | 100% | 0%
src/helpers0% | 0% | 0% | 0% | 100%
src/plugins0% | 0% | 0% | 0% | 100%
swagger-ui-dist-package0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
160 83 5
function systemExtend()
in src/core/system.js
58 28 2
export default function authorize()
in src/core/oauth2-authorize.js
97 26 6
155 24 1
export default function()
in src/core/plugins/err/reducers.js
69 11 0
16 11 3
function objectToKeyValueString()
in docker/configurator/translator.js
34 10 4
15 9 1
export function stringify()
in src/core/utils.js
20 9 1
function createTailoredParameterError()
in src/core/plugins/err/error-transformers/transformers/parameter-oneof.js
25 8 2
function getScrollParent()
in src/core/plugins/deep-linking/layout.js
17 7 2
export default function downloadUrlPlugin()
in src/core/plugins/download-url.js
48 7 1
function next()
in src/core/plugins/download-url.js
13 7 1
27 7 1
export function mapToList()
in src/core/utils.js
23 7 3
14 7 3
function makeNewMessage()
in src/core/plugins/err/error-transformers/transformers/not-of-type.js
13 6 1
export function contentTypeValues()
in src/core/plugins/spec/selectors.js
17 6 2
function checkPossibleFailReasons()
in src/core/plugins/download-url.js
28 6 0
getWrappedAndBoundActions()
in src/core/system.js
27 6 1