microsoft / psi
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 5,115 units with 65,153 lines of code in units (62.1% of code).
    • 18 very long units (2,601 lines of code)
    • 114 long units (7,530 lines of code)
    • 685 medium size units (21,022 lines of code)
    • 1,138 small units (16,628 lines of code)
    • 3,160 very small units (17,372 lines of code)
3% | 11% | 32% | 25% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs4% | 11% | 32% | 25% | 26%
cpp0% | 32% | 38% | 13% | 15%
h0% | 0% | 34% | 13% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/Imaging15% | 22% | 22% | 20% | 19%
Sources/Kinect26% | 24% | 28% | 8% | 11%
Sources/Runtime1% | 12% | 31% | 25% | 28%
Sources/Visualization2% | 5% | 36% | 27% | 28%
Sources/Audio7% | 10% | 27% | 29% | 24%
Sources/Calibration22% | 25% | 27% | 15% | 7%
Sources/Tools10% | 14% | 31% | 25% | 17%
Sources/Common71% | 0% | 0% | 28% | 0%
Sources/Media4% | 29% | 22% | 21% | 21%
Sources/Data0% | 6% | 39% | 23% | 30%
Sources/Language0% | 93% | 0% | 0% | 6%
Sources/Integrations0% | 0% | 40% | 33% | 25%
Sources/Speech0% | 0% | 31% | 29% | 39%
Sources/RealSense0% | 0% | 60% | 10% | 29%
Sources/Filters0% | 0% | 0% | 83% | 16%
Sources/Toolkits0% | 0% | 0% | 25% | 74%
Sources/Devices0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void ComputeFFT()
in Sources/Audio/Microsoft.Psi.Audio/AcousticFeatures/FastFourierTransform.cs
249 13 2
private Graph BuildVisualGraph()
in Sources/Visualization/Microsoft.Psi.Visualization.Windows/Views/Visuals2D/DiagnosticsVisualization/PipelineDiagnosticsVisualizationPresenter.cs
184 52 2
public static Mesh MeshFromDepthMap()
in Sources/Kinect/Test.Psi.Kinect.Windows.x64/Mesh.cs
182 24 3
public DerivedStreamContainerTreeNode AddDerivedReceiverDiagnosticsChildren()
in Sources/Visualization/Microsoft.Psi.Visualization.Windows/ViewModels/PipelineDiagnosticsStreamTreeNode.cs
169 5 1
public void TestDistortion()
in Sources/Calibration/Test.Psi.Calibration/DistortionTests.cs
166 22 0
public static void CopyTo()
in Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs
154 40 5
private void CaptureThreadProc()
in Sources/Kinect/Microsoft.Psi.AzureKinect.x64/AzureKinectCore.cs
150 23 0
internal static int ExecuteTask()
in Sources/Tools/PsiStoreTool/Utility.cs
140 27 6
public static void Threshold()
in Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs
139 44 5
public void CopyTo()
in Sources/Imaging/Microsoft.Psi.Imaging/ImageBase.cs
133 23 5
private void CopyImageSlow()
in Sources/Imaging/Microsoft.Psi.Imaging/ImageBase.cs
132 27 5
public unsafe void BufferEx_Read_Managed_Perf()
in Sources/Runtime/Test.Psi/MemoryAccessPerf.cs
127 23 0
public static void RunAll()
in Sources/Common/Test.Psi.Common/TestRunner.cs
123 19 1
public void DynamicWindow()
in Sources/Runtime/Test.Psi/OperatorTests.cs
119 4 0
public void PsiStreamMetadataTest()
in Sources/Runtime/Test.Psi/SerializationTester.cs
119 10 0
internal void RecoverCalibrationFromSensor()
in Sources/Kinect/Microsoft.Psi.Kinect.Windows/KinectInternalCalibration.cs
107 16 1
private static double CalibrateColorCamera()
in Sources/Kinect/Microsoft.Psi.Kinect.Windows/KinectInternalCalibration.cs
104 6 7
public unsafe void Start()
in Sources/Media/Microsoft.Psi.Media.Linux/MediaCapture.cs
104 19 1
void MediaCaptureDevice::CurrentFormat::set()
in Sources/Media/Microsoft.Psi.Media_Interop.Windows.x64/MediaCaptureDevice.cpp
100 15 1
public static bool Compare()
in Sources/Imaging/Microsoft.Psi.Imaging/ImageExtensions.cs
98 17 5