microsoft / ChakraCore-Debugger
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 998 units with 7,303 lines of code in units (54.6% of code).
    • 1 very long units (113 lines of code)
    • 15 long units (859 lines of code)
    • 57 medium size units (1,748 lines of code)
    • 110 small units (1,613 lines of code)
    • 815 very small units (2,970 lines of code)
1% | 11% | 23% | 22% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp1% | 13% | 27% | 24% | 33%
h0% | 0% | 0% | 3% | 96%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/Debugger.ProtocolHandler4% | 7% | 23% | 27% | 35%
lib/Debugger.Protocol/Generated/protocol0% | 14% | 23% | 19% | 41%
lib/Debugger.Service0% | 0% | 30% | 27% | 41%
lib/Debugger.Protocol0% | 0% | 24% | 15% | 59%
lib/Debugger.Protocol/Generated/include0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
std::string JsErrorException::TranslateError()
in lib/Debugger.ProtocolHandler/ErrorHelpers.cpp
113 49 1
Response DebuggerImpl::setBreakpointByUrl()
in lib/Debugger.ProtocolHandler/DebuggerImpl.cpp
67 9 7
DispatchResponse::Status DispatcherImpl::evaluate()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
65 21 3
DispatchResponse::Status DispatcherImpl::evaluateOnCallFrame()
in lib/Debugger.Protocol/Generated/protocol/Debugger.cpp
61 18 3
DispatchResponse::Status DispatcherImpl::runScript()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
59 19 3
std::unique_ptr ScriptParsedNotification::fromValue()
in lib/Debugger.Protocol/Generated/protocol/Debugger.cpp
58 8 2
Token parseToken()
in lib/Debugger.Protocol/Generated/protocol/Protocol.cpp
58 28 4
std::unique_ptr PropertyDescriptor::fromValue()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
58 11 2
JsValueRef RuntimeImpl::GetTypeString()
in lib/Debugger.ProtocolHandler/RuntimeImpl.cpp
58 17 1
std::unique_ptr RemoteObject::fromValue()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
57 12 2
DispatchResponse::Status DispatcherImpl::callFunctionOn()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
56 18 3
void DebuggerImpl::HandleSourceEvent()
in lib/Debugger.ProtocolHandler/DebuggerImpl.cpp
55 6 2
std::unique_ptr ScriptFailedToParseNotification::fromValue()
in lib/Debugger.Protocol/Generated/protocol/Debugger.cpp
53 7 2
bool decodeString()
in lib/Debugger.Protocol/Generated/protocol/Protocol.cpp
52 15 3
DispatchResponse::Status DispatcherImpl::setBreakpointByUrl()
in lib/Debugger.Protocol/Generated/protocol/Debugger.cpp
51 14 3
std::unique_ptr ExceptionDetails::fromValue()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
51 9 2
DispatchResponse::Status UberDispatcher::dispatch()
in lib/Debugger.Protocol/Generated/protocol/Protocol.cpp
49 14 3
DispatchResponse::Status DispatcherImpl::getProperties()
in lib/Debugger.Protocol/Generated/protocol/Runtime.cpp
49 14 3
SkipPauseRequest DebuggerImpl::EvaluateConditionOnBreakpoint()
in lib/Debugger.ProtocolHandler/DebuggerImpl.cpp
46 10 1
Response RuntimeImpl::getProperties()
in lib/Debugger.ProtocolHandler/RuntimeImpl.cpp
46 7 7