opensearch-project / sql
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 6,738 units with 58,891 lines of code in units (61.3% of code).
    • 45 very long units (7,900 lines of code)
    • 99 long units (6,395 lines of code)
    • 386 medium size units (11,765 lines of code)
    • 710 small units (10,111 lines of code)
    • 5,498 very small units (22,720 lines of code)
13% | 10% | 19% | 17% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c33% | 22% | 26% | 11% | 5%
java3% | 4% | 14% | 19% | 57%
h14% | 10% | 26% | 14% | 34%
cpp11% | 16% | 39% | 17% | 14%
tsx18% | 31% | 16% | 22% | 10%
ts38% | 0% | 10% | 13% | 37%
js0% | 87% | 0% | 12% | 0%
py0% | 0% | 45% | 28% | 26%
hpp0% | 0% | 9% | 11% | 78%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sql-odbc26% | 19% | 27% | 13% | 13%
legacy7% | 8% | 20% | 21% | 42%
workbench22% | 27% | 13% | 19% | 16%
opensearch0% | 4% | 4% | 33% | 57%
sql-jdbc0% | <1% | 8% | 13% | 77%
core0% | 0% | 9% | 16% | 73%
sql-cli0% | 0% | 45% | 28% | 26%
plugin0% | 0% | 17% | 44% | 38%
sql0% | 0% | 6% | 14% | 79%
ppl0% | 0% | 4% | 20% | 75%
common0% | 0% | 0% | 14% | 85%
protocol0% | 0% | 0% | 5% | 94%
Alternative Visuals
Longest Units
Top 20 longest 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
public final SQLExpr primaryRest()
in legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java
268 62 1
RETCODE SQL_API OPENSEARCHAPI_ExtendedFetch()
in sql-odbc/src/sqlodbc/results.c
259 71 7
public Tuple function()
in legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java
259 84 4
RETCODE SQL_API OPENSEARCHAPI_GetFunctions()
in sql-odbc/src/sqlodbc/info.c
228 66 3
void ParseNumber()
in sql-odbc/libraries/rapidjson/include/rapidjson/reader.h
225 92 2
private void explainCond()
in legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java
221 54 3
static RETCODE set_statement_option()
in sql-odbc/src/sqlodbc/options.c
219 66 4
RETCODE SQL_API OPENSEARCHAPI_GetData()
in sql-odbc/src/sqlodbc/results.c
208 37 6
private ToXContent make()
in legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java
177 53 3
static int setup_getdataclass()
in sql-odbc/src/sqlodbc/convert.c
171 45 9
RETCODE SQL_API OPENSEARCHAPI_DescribeCol()
in sql-odbc/src/sqlodbc/results.c
164 40 9
static RETCODE SQL_API ARDGetField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
162 46 6
RETCODE static EnlistInDtc_1pipe()
in sql-odbc/src/opensearchenlist/msdtc_enlist.cpp
153 26 4
RAPIDJSON_FORCEINLINE IterativeParsingState Predict()
in sql-odbc/libraries/rapidjson/include/rapidjson/reader.h
147 1 2
static RETCODE SQL_API APDGetField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
145 38 6
static RETCODE SQL_API IPDGetField()
in sql-odbc/src/sqlodbc/opensearch_api30.c
139 45 6