microsoft / bond
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,852 units with 19,605 lines of code in units (47.8% of code).
    • 1 very long units (143 lines of code)
    • 13 long units (775 lines of code)
    • 101 medium size units (3,287 lines of code)
    • 319 small units (4,510 lines of code)
    • 2,418 very small units (10,890 lines of code)
<1% | 3% | 16% | 23% | 55%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs2% | 6% | 26% | 20% | 44%
java0% | 3% | 8% | 22% | 65%
h0% | 1% | 14% | 25% | 58%
py0% | 0% | 34% | 30% | 35%
groovy0% | 0% | 0% | 55% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cs/src2% | 6% | 26% | 20% | 44%
java/core0% | 2% | 8% | 20% | 68%
cpp/inc0% | 1% | 13% | 26% | 57%
java/compat0% | 100% | 0% | 0% | 0%
python/inc0% | 0% | 21% | 12% | 66%
java/json0% | 0% | 12% | 54% | 32%
compiler/extra0% | 0% | 58% | 0% | 41%
tools/ci-scripts0% | 0% | 23% | 43% | 33%
java/gradle-plugin0% | 0% | 0% | 55% | 44%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Expression Container()
in cs/src/core/expressions/DeserializerTransform.cs
143 9 4
public void skip()
in java/core/src/main/java/org/bondlib/SimpleBinaryReader.java
79 23 2
public static void main()
in java/compat/src/main/java/org/bondlib/compat/CompatDriver.java
70 14 1
Expression Field()
in cs/src/core/expressions/ObjectParser.cs
67 13 5
internal override void EndOfStream()
in cs/src/io/unsafe/InputStream.cs
67 13 1
public Expression Apply()
in cs/src/core/expressions/TaggedParser.cs
61 4 1
static Cache()
in cs/src/core/expressions/ParserFactory.cs
58 9 0
inline void SimpleBinaryWriter::WriteFieldOmitted()
in cpp/inc/bond/protocol/simple_binary_impl.h
57 18 3
public void writeFieldOmitted()
in java/core/src/main/java/org/bondlib/SimpleBinaryWriter.java
55 18 3
public void WriteFieldOmitted()
in cs/src/core/protocols/SimpleBinary.cs
54 17 3
public override Expression Scalar()
in cs/src/json/expressions/json/SimpleJsonParser.cs
53 7 3
bool OmittedField()
in cpp/inc/bond/protocol/simple_json_writer.h
52 20 3
public static ulong DecodeVarUInt64()
in cs/src/core/io/IntegerHelper.cs
51 10 2
public unsafe static ulong DecodeVarUInt64()
in cs/src/io/unsafe/IntegerHelper.cs
51 10 2
50 25 1
static Cache()
in cs/src/core/expressions/SerializerGeneratorFactory.cs
50 7 0
public static int EncodeVarUInt64()
in cs/src/core/io/IntegerHelper.cs
50 10 3
public unsafe static int EncodeVarUInt64()
in cs/src/io/unsafe/IntegerHelper.cs
50 10 3
static int encodeVarUInt64()
in java/core/src/main/java/org/bondlib/VarUIntHelper.java
50 11 2
static Variant GetDefaultValue()
in cs/src/core/Schema.cs
49 25 1