microsoft / cppgraphqlgen
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 601 units with 10,595 lines of code in units (57.5% of code).
    • 15 very long units (3,326 lines of code)
    • 25 long units (1,606 lines of code)
    • 72 medium size units (2,268 lines of code)
    • 86 small units (1,263 lines of code)
    • 403 very small units (2,132 lines of code)
31% | 15% | 21% | 11% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp34% | 15% | 22% | 11% | 16%
h0% | 8% | 9% | 20% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src36% | 15% | 24% | 9% | 13%
src/introspection0% | 13% | 0% | 27% | 59%
include/graphqlservice0% | 18% | 18% | 26% | 36%
include/graphqlservice/internal0% | 0% | 0% | 18% | 81%
include/graphqlservice/introspection0% | 0% | 0% | 0% | 100%
include0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
874 105 3
bool Generator::outputHeader()
in src/SchemaGenerator.cpp
301 47 0
252 51 3
249 33 3
246 31 0
199 29 1
bool Generator::outputSource()
in src/ClientGenerator.cpp
194 24 0
int main()
in src/ClientGenerator.cpp
153 23 2
150 23 1
131 25 2
126 27 0
118 21 4
116 21 0
bool Generator::outputHeader()
in src/ClientGenerator.cpp
110 12 0
void SelectionVisitor::visitField()
in src/GraphQLService.cpp
107 12 1
86 15 1
void AddTypesToSchema()
in src/introspection/IntrospectionSchema.cpp
86 1 1
79 10 1
static typename std::enable_if_t convert()
in include/graphqlservice/GraphQLService.h
77 12 2
75 13 3