opensearch-project / opensearch-js
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 183 units with 2,960 lines of code in units (44.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (66 lines of code)
    • 19 medium complex units (897 lines of code)
    • 34 simple units (865 lines of code)
    • 129 very simple units (1,132 lines of code)
0% | 2% | 30% | 29% | 38%
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
js0% | 2% | 30% | 29% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts/utils0% | 6% | 50% | 17% | 26%
api/api0% | 0% | 30% | 50% | 19%
lib0% | 0% | 14% | 14% | 70%
scripts0% | 0% | 0% | 26% | 73%
lib/pool0% | 0% | 0% | 100% | 0%
ROOT0% | 0% | 0% | 42% | 57%
api0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function generateDocs()
in scripts/utils/generateDocs.js
66 45 2
function buildPath()
in scripts/utils/generateApis.js
70 21 0
function genFactory()
in scripts/utils/generateMain.js
151 20 3
function generateSingleApi()
in scripts/utils/generateApis.js
75 19 3
function termvectorsApi()
in api/api/termvectors.js
30 18 3
function getType()
in scripts/utils/generateRequestTypes.js
44 18 2
function indexApi()
in api/api/index.js
34 15 3
function generateRequestType()
in scripts/utils/generateRequestTypes.js
59 15 1
function searchTemplateApi()
in api/api/search_template.js
31 14 3
function mgetApi()
in api/api/mget.js
31 14 3
function tryBulk()
in lib/Helpers.js
45 13 2
function countApi()
in api/api/count.js
27 13 3
function existsSourceApi()
in api/api/exists_source.js
35 13 3
function mtermvectorsApi()
in api/api/mtermvectors.js
27 13 3
function msearchApi()
in api/api/msearch.js
31 13 3
function msearchTemplateApi()
in api/api/msearch_template.js
31 13 3
function generateApiDoc()
in scripts/utils/generateDocs.js
62 13 1
for await()
in lib/Helpers.js
35 11 1
function explainApi()
in api/api/explain.js
28 11 3
function buildMethodDefinition()
in scripts/utils/generateMain.js
51 11 6