microsoft / Ironclad
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,741 units with 33,047 lines of code in units (52.6% of code).
    • 20 very long units (3,684 lines of code)
    • 59 long units (3,860 lines of code)
    • 292 medium size units (8,559 lines of code)
    • 497 small units (7,274 lines of code)
    • 1,873 very small units (9,670 lines of code)
11% | 11% | 25% | 22% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs11% | 11% | 25% | 21% | 29%
py0% | 14% | 22% | 29% | 32%
cpp0% | 0% | 31% | 9% | 59%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ironclad-apps/tools/DafnyCC41% | 14% | 19% | 13% | 10%
ironclad-apps/tools/DafnySpec32% | 10% | 20% | 11% | 24%
ironclad-apps/tools/NuBuild3% | 12% | 27% | 22% | 33%
ironclad-apps/tools/NuBuild23% | 12% | 27% | 22% | 33%
ironclad-apps/tools/BoogieAsm59% | 0% | 37% | 0% | 3%
ironfleet/src/IronSHTClient21% | 35% | 4% | 16% | 21%
ironclad-apps/src/Clients0% | 9% | 30% | 28% | 31%
ironfleet/tools/scripts0% | 19% | 17% | 36% | 26%
ironfleet/src/IronRSLKVServer0% | 14% | 28% | 20% | 36%
ironfleet/src/Dafny0% | 4% | 30% | 38% | 26%
ironfleet/src/RedisClient0% | 0% | 56% | 22% | 21%
ironfleet/src/IronRSLKVClient0% | 0% | 58% | 24% | 17%
ironfleet/src/IronfleetCommon0% | 0% | 48% | 13% | 37%
ironfleet/src/TestIoFramework0% | 0% | 43% | 39% | 16%
ironfleet/src/IronLockServer0% | 0% | 61% | 30% | 8%
ironfleet/src/IronRSLCounterClient0% | 0% | 35% | 31% | 32%
ironfleet/src/IronSHTServer0% | 0% | 47% | 43% | 9%
ironfleet/tools/DepGraph0% | 0% | 75% | 20% | 3%
ironclad-apps/src/Checked0% | 0% | 60% | 18% | 21%
ironclad-apps/tools/scripts0% | 0% | 83% | 0% | 16%
ironclad-apps/tools/Dafny0% | 0% | 3% | 39% | 56%
ironfleet/src/CreateIronServiceCerts0% | 0% | 0% | 87% | 12%
ironclad-apps/src/DafnyTestDriver0% | 0% | 0% | 43% | 56%
ironfleet/src/IronRSLClient0% | 0% | 0% | 100% | 0%
ironclad-apps/tools/standalone0% | 0% | 0% | 0% | 100%
ironfleet/src/IronRSLCounterServer0% | 0% | 0% | 0% | 100%
ironclad-apps/src/Dafny0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public List Alloc()
in ironclad-apps/tools/DafnyCC/RegAlloc.cs
432 88 0
public RtlExp GhostExpressionRec()
in ironclad-apps/tools/DafnySpec/Compile.cs
387 110 3
void AddExpression()
in ironclad-apps/tools/DafnyCC/CompileMethod.cs
330 71 2
public override void Compile()
in ironclad-apps/tools/DafnyCC/CompileMethod.cs
308 61 0
public void Compile()
in ironclad-apps/tools/DafnySpec/CompileFunction.cs
266 57 0
public virtual void AddResolvedGhostStatement()
in ironclad-apps/tools/DafnySpec/Compile.cs
198 29 2
List GenerateAutoReqs()
in ironclad-apps/tools/DafnySpec/ParseMain.cs
156 36 2
void AddResolvedStatement()
in ironclad-apps/tools/DafnyCC/CompileMethod.cs
152 27 1
void parseArgs()
in ironclad-apps/tools/NuBuild/NuBuild/Program.cs
140 32 1
void parseArgs()
in ironclad-apps/tools/NuBuild2/NuBuild/Program.cs
140 32 1
void CompileDatatype2()
in ironclad-apps/tools/DafnyCC/DafnyCC.cs
134 17 2
public Tuple GetSeqBuildMethod()
in ironclad-apps/tools/DafnyCC/DafnyCC.cs
132 15 3
public void CompileInstruction()
in ironclad-apps/tools/DafnyCC/CompileMethod.cs
125 27 0
private static void CheckResults()
in ironclad-apps/tools/NuBuild/ItemCacheTool/Program.cs
122 21 2
private static void CheckResults()
in ironclad-apps/tools/NuBuild2/ItemCacheTool/Program.cs
122 21 2
public void Merge()
in ironclad-apps/tools/BoogieAsm/SymdiffMerge.cs
115 30 3
public void Experiment()
in ironfleet/src/IronSHTClient/Client.cs
109 13 0
public static void Resolve()
in ironclad-apps/tools/DafnySpec/ParseMain.cs
108 24 2
private static void Main()
in ironclad-apps/tools/NuBuild/ItemCacheTool/Program.cs
104 24 1
private static void Main()
in ironclad-apps/tools/NuBuild2/ItemCacheTool/Program.cs
104 24 1