microsoft / jupyter-core
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 133 units with 2,088 lines of code in units (56.0% of code).
    • 1 very long units (136 lines of code)
    • 4 long units (284 lines of code)
    • 27 medium size units (809 lines of code)
    • 27 small units (414 lines of code)
    • 74 very small units (445 lines of code)
6% | 13% | 38% | 19% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs6% | 13% | 38% | 19% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src34% | 23% | 25% | 11% | 5%
src/Engines0% | 19% | 53% | 8% | 19%
src/Servers0% | 24% | 24% | 34% | 15%
src/ShellRouting0% | 0% | 37% | 38% | 23%
src/ResultEncoding0% | 0% | 38% | 35% | 25%
src/Extensions0% | 0% | 36% | 25% | 37%
src/Symbols0% | 0% | 58% | 16% | 25%
src/Data0% | 0% | 0% | 20% | 79%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public int InstallKernelSpec()
in src/KernelApplication.cs
136 12 8
91 8 1
protected async virtual Task ExecutionTaskForMessage()
in src/Engines/ExecuteRequestHandler.cs
88 4 3
public virtual void OnKernelInfoRequest()
in src/Servers/ShellServer.cs
54 2 1
public async Task HandleAsync()
in src/Engines/CompleteRequestHandler.cs
51 5 1
public virtual async Task Complete()
in src/Engines/BaseEngine.cs
47 8 2
public static Message ReceiveMessage()
in src/Extensions/Messages.cs
47 3 3
public EncodedData? Encode()
in src/ResultEncoding/Table.cs
41 6 1
public override async Task HandleAsync()
in src/Engines/ExecuteRequestHandler.cs
40 5 3
36 3 1
public EncodedData? Encode()
in src/ResultEncoding/Table.cs
36 2 1
35 1 1
protected async Task SendAbortMessage()
in src/Engines/ExecuteRequestHandler.cs
33 1 1
internal MimeBundle EncodeForDisplay()
in src/Engines/BaseEngine.cs
32 6 1
public CommandType GetNextCommand()
in src/Engines/InputParser.cs
30 10 4
public virtual Task HandleAsync()
in src/ShellRouting/OrderedShellHandler.cs
30 3 3
public async Task ExecuteAndNotify()
in src/Engines/BaseEngine.cs
29 1 5
private void WriteDisplayData()
in src/Engines/BaseEngine.cs
28 3 4
public virtual Task ExecuteMundane()
in src/Engines/BaseEngine.cs
28 1 3
28 1 2