microsoft / GraphEngine
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 4,616 units with 46,655 lines of code in units (53.1% of code).
    • 12 very long units (1,842 lines of code)
    • 67 long units (4,390 lines of code)
    • 429 medium size units (12,843 lines of code)
    • 833 small units (12,097 lines of code)
    • 3,275 very small units (15,483 lines of code)
3% | 9% | 27% | 25% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs4% | 7% | 25% | 27% | 34%
cpp4% | 17% | 38% | 22% | 17%
hpp3% | 5% | 16% | 24% | 49%
h0% | 2% | 24% | 22% | 50%
scala0% | 0% | 29% | 13% | 56%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Trinity.TSL6% | 13% | 26% | 20% | 33%
src/Trinity.C4% | 14% | 34% | 20% | 26%
src/Modules2% | 2% | 26% | 35% | 33%
src/Trinity.C.UnitTest3% | 5% | 16% | 25% | 49%
src/Trinity.VSExtension12% | 20% | 25% | 14% | 26%
src/Trinity.Core1% | 6% | 29% | 29% | 33%
src/GraphEngine.DataImporter0% | 19% | 35% | 20% | 24%
src/Trinity.Core.SmokeTest0% | 50% | 0% | 31% | 18%
src/Trinity.Core.UnitTest0% | 0% | 0% | 86% | 13%
tools/versioning0% | 0% | 0% | 47% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void MODULE_CALL()
in src/Trinity.TSL/Trinity.TSL.Metagen/VM.cs
379 49 0
void MemoryTrunk::DefragmentTwoRegion()
in src/Trinity.C/src/Storage/MemoryTrunk/MemoryTrunk.DefragTwoRegion.cpp
176 41 3
clara::Parser makeCommandLineParser()
in src/Trinity.C.UnitTest/catch.hpp
175 24 1
internal static unsafe bool TryParse_t_data_type_display()
in src/Trinity.TSL/Trinity.TSL.CodeTemplates/ExternalParser.cs
148 21 2
private List _PullSelectionsAndAssembleResults()
in src/Modules/LIKQ/FanoutSearch/Core/FanoutSearchModule.Core.cs
146 30 3
private List BuildSyntaxSpans()
in src/Trinity.VSExtension/TrinityVSExtension/EditorExtension/TSL/TSLParser.cs
141 31 2
private void _LoadWriteAheadLogFile()
in src/Trinity.Core/Storage/LocalMemoryStorage/LocalMemoryStorage.WriteAheadLog.cs
131 24 0
private List SearchSubString()
in src/Trinity.TSL/Trinity.TSL.CodeTemplates/InvertedIndex/Bigram/Searcher.cs
116 28 1
void MemoryTrunk::DefragmentOneRegion()
in src/Trinity.C/src/Storage/MemoryTrunk/MemoryTrunk.DefragOneRegion.cpp
115 24 3
CELL_LOCK_PROTECTED TrinityErrorCode MTHash::ResizeCell()
in src/Trinity.C/src/Storage/MTHash/MTHash.Cell.cpp
106 16 4
internal List SubstringSearch()
in src/Trinity.TSL/Trinity.TSL.CodeTemplates/InvertedIndex/Bigram/Searcher.cs
106 27 1
private unsafe void FanoutSearch_impl_Recv()
in src/Modules/LIKQ/FanoutSearch/Core/FanoutSearchModule.Core.cs
103 20 1
void _eventloop()
in src/Trinity.C/src/Events/Events.cpp
100 16 0
internal static string GetResourceName()
in src/Trinity.Core/Trinity/Lib/ThrowHelper.cs
99 47 1
private static void ToString_impl()
in src/Trinity.TSL/Trinity.TSL.CodeTemplates/Serializer.cs
99 10 3
static std::string translatorName()
in src/Trinity.C.UnitTest/catch.hpp
92 5 1
VOID PrintExceptionRecord()
in src/Trinity.C/src/Debugger/Debugger.Exception.cpp
92 26 1
bool MemoryTrunk::CommittedMemoryExpand()
in src/Trinity.C/src/Storage/MemoryTrunk/MemoryTrunk.Memory.cpp
89 22 1
static int yy_get_next_buffer()
in src/Trinity.TSL/Trinity.TSL.Parser/lex.flex.cpp
87 15 1
static int yy_get_next_buffer()
in src/Trinity.TSL/Trinity.TSL.Parser/lex.linux.cpp
87 15 1