opensearch-project / sql
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 6,738 units with 58,891 lines of code in units (61.3% of code).
    • 13 very complex units (3,875 lines of code)
    • 31 complex units (3,621 lines of code)
    • 146 medium complex units (7,431 lines of code)
    • 288 simple units (7,933 lines of code)
    • 6,260 very simple units (36,031 lines of code)
6% | 6% | 12% | 13% | 61%
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
c17% | 16% | 24% | 17% | 24%
java2% | 1% | 6% | 9% | 80%
h4% | 8% | 19% | 14% | 53%
cpp0% | 7% | 11% | 35% | 44%
tsx0% | 0% | 24% | 6% | 69%
hpp0% | 0% | 12% | 0% | 87%
py0% | 0% | 7% | 31% | 61%
ts0% | 0% | 0% | 5% | 94%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sql-odbc12% | 13% | 21% | 19% | 33%
legacy5% | 2% | 10% | 15% | 66%
workbench0% | 0% | 15% | 5% | 78%
opensearch0% | 0% | 5% | <1% | 93%
sql-jdbc0% | 0% | 1% | 4% | 93%
core0% | 0% | 1% | 3% | 95%
sql-cli0% | 0% | 7% | 31% | 61%
ppl0% | 0% | 0% | 2% | 97%
plugin0% | 0% | 0% | 2% | 97%
sql0% | 0% | 0% | 0% | 100%
protocol0% | 0% | 0% | 0% | 100%
common0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
RETCODE SQL_API OPENSEARCHAPI_GetInfo()
in sql-odbc/src/sqlodbc/info.c
732 194 5
int copy_and_convert_field()
in sql-odbc/src/sqlodbc/convert.c
530 152 10
RETCODE SQL_API OPENSEARCHAPI_ColAttributes()
in sql-odbc/src/sqlodbc/results.c
351 131 7
RETCODE SQL_API OPENSEARCHAPI_GetDiagField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
281 94 7
void ParseNumber()
in sql-odbc/libraries/rapidjson/include/rapidjson/reader.h
225 92 2
public Tuple function()
in legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java
259 84 4
RETCODE SQL_API OPENSEARCHAPI_ExtendedFetch()
in sql-odbc/src/sqlodbc/results.c
259 71 7
RETCODE SQL_API OPENSEARCHAPI_GetFunctions()
in sql-odbc/src/sqlodbc/info.c
228 66 3
static RETCODE set_statement_option()
in sql-odbc/src/sqlodbc/options.c
219 66 4
static int opensearch_CS_stat()
in sql-odbc/src/sqlodbc/multibyte.c
125 62 3
public final SQLExpr primaryRest()
in legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java
268 62 1
private void explainCond()
in legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java
221 54 3
private ToXContent make()
in legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java
177 53 3
static BOOL interval2istruct()
in sql-odbc/src/sqlodbc/convert.c
103 47 4
static RETCODE SQL_API ARDGetField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
162 46 6
static RETCODE SQL_API IPDGetField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
139 45 6
static int setup_getdataclass()
in sql-odbc/src/sqlodbc/convert.c
171 45 9
static RETCODE SQL_API IRDGetField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
107 43 6
RETCODE SQL_API OPENSEARCHAPI_ConnectError()
in sql-odbc/src/sqlodbc/environ.c
112 42 8
RETCODE SQL_API OPENSEARCHAPI_SetConnectOption()
in sql-odbc/src/sqlodbc/options.c
125 42 3