microsoft / thrifty
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 749 units with 7,105 lines of code in units (54.0% of code).
    • 0 very long units (0 lines of code)
    • 21 long units (1,496 lines of code)
    • 54 medium size units (1,737 lines of code)
    • 94 small units (1,404 lines of code)
    • 580 very small units (2,468 lines of code)
0% | 21% | 24% | 19% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt0% | 22% | 24% | 19% | 33%
java0% | 0% | 29% | 21% | 48%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
thrifty-runtime/src/commonMain0% | 39% | 22% | 11% | 25%
thrifty-kotlin-codegen/src/main0% | 32% | 19% | 16% | 31%
thrifty-runtime/src/commonTest0% | 8% | 20% | 28% | 42%
thrifty-schema/src/main0% | 0% | 28% | 36% | 35%
thrifty-java-codegen/src/main0% | 0% | 24% | 19% | 55%
thrifty-gradle-plugin/src/main0% | 0% | 31% | 20% | 47%
thrifty-compiler/src/main0% | 0% | 100% | 0% | 0%
thrifty-runtime/src/jvmMain0% | 0% | 30% | 33% | 36%
thrifty-example-postprocessor/src/main0% | 0% | 0% | 59% | 40%
thrifty-compiler-plugins/src/main0% | 0% | 0% | 47% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fun recursivelyRenderConstValue()
in thrifty-kotlin-codegen/src/main/kotlin/com/microsoft/thrifty/kgen/KotlinCodeGenerator.kt
98 15 3
fun generate()
in thrifty-kotlin-codegen/src/main/kotlin/com/microsoft/thrifty/kgen/KotlinCodeGenerator.kt
91 8 1
fun writeMessageBegin()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
86 1 3
fun writeMessageEnd()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
84 1 0
fun writeStructBegin()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
82 1 1
fun writeStructEnd()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
80 1 0
fun writeFieldBegin()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
78 1 3
fun writeFieldEnd()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
76 1 0
fun writeFieldStop()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
74 1 0
fun writeMapBegin()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
72 1 3
fun writeMapEnd()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
70 1 0
fun writeListBegin()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
68 1 2
fun writeListEnd()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
66 1 0
override fun read()
in thrifty-runtime/src/commonTest/kotlin/com/microsoft/thrifty/protocol/Xtruct.kt
65 9 2
fun writeSetBegin()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
64 1 2
fun writeSetEnd()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
62 1 0
fun writeBool()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
60 1 1
fun writeByte()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
58 1 1
fun writeI16()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
56 1 1
fun writeI32()
in thrifty-runtime/src/commonMain/kotlin/com/microsoft/thrifty/protocol/Protocol.kt
54 1 1