microsoft / BosqueLanguage
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 2,700 units with 25,327 lines of code in units (53.1% of code).
    • 15 very long units (4,308 lines of code)
    • 49 long units (3,410 lines of code)
    • 157 medium size units (4,812 lines of code)
    • 281 small units (4,028 lines of code)
    • 2,198 very small units (8,769 lines of code)
17% | 13% | 18% | 15% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hpp33% | 18% | 15% | 11% | 20%
cpp13% | 15% | 28% | 23% | 19%
ts7% | 11% | 22% | 14% | 44%
js0% | 90% | 0% | 0% | 9%
h0% | 0% | 5% | 15% | 79%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
impl/build/include/headers26% | 14% | 12% | 12% | 34%
impl/src/tooling/icpp16% | 7% | 20% | 23% | 32%
impl/src/tooling/verifier6% | 25% | 31% | 16% | 19%
impl/src/compiler6% | 0% | 21% | 10% | 60%
impl/src/ast0% | 8% | 23% | 18% | 50%
bosque-language-tools/out0% | 98% | 0% | 0% | 1%
bosque-language-tools/src0% | 98% | 0% | 0% | 1%
impl/src/type_checker0% | 0% | 20% | 39% | 39%
impl/src/runtimes0% | 0% | 0% | 100% | 0%
impl/build0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void Evaluator::evaluateOpCode()
in impl/src/tooling/icpp/interpreter/op_eval.cpp
853 156 1
token_type scan_string()
in impl/build/include/headers/json/json.hpp
488 212 0
bool parse_cbor_internal()
in impl/build/include/headers/json/json.hpp
383 233 2
bool parse_msgpack_internal()
in impl/build/include/headers/json/json.hpp
339 273 0
token_type scan_number()
in impl/build/include/headers/json/json.hpp
266 98 0
void write_cbor()
in impl/build/include/headers/json/json.hpp
263 50 1
void write_msgpack()
in impl/build/include/headers/json/json.hpp
258 56 1
private initializeSMTAssembly()
in impl/src/tooling/verifier/smtdecls_emitter.ts
250 46 3
void dump()
in impl/build/include/headers/json/json.hpp
221 30 5
bool sax_parse_internal()
in impl/build/include/headers/json/json.hpp
205 41 1
void dump_escaped()
in impl/build/include/headers/json/json.hpp
194 28 2
basic_json patch()
in impl/build/include/headers/json/json.hpp
185 31 1
void write_ubjson()
in impl/build/include/headers/json/json.hpp
171 35 4
static jparse()
in impl/src/compiler/mir_ops.ts
119 57 1
private processAssembly()
in impl/src/tooling/icpp/transpiler/icppdecls_emitter.ts
113 20 1
inline cached_power get_cached_power_for_binary_exponent()
in impl/build/include/headers/json/json.hpp
100 1 1
private processListTypeDecl()
in impl/src/tooling/verifier/smtdecls_emitter.ts
97 15 1
function wfWitnessSmall()
in impl/src/tooling/verifier/smt_workflows.ts
96 26 8
void Evaluator::evaluatePrimitiveBody()
in impl/src/tooling/icpp/interpreter/op_eval.cpp
95 25 3
private walkAndGenerateHavocType()
in impl/src/tooling/verifier/smtdecls_emitter.ts
94 29 3