microsoft / VSSDK-Extensibility-Samples
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 1,398 units with 17,209 lines of code in units (56.8% of code).
    • 4 very long units (491 lines of code)
    • 26 long units (1,718 lines of code)
    • 187 medium size units (5,834 lines of code)
    • 283 small units (4,082 lines of code)
    • 898 very small units (5,084 lines of code)
2% | 9% | 33% | 23% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs3% | 9% | 35% | 23% | 28%
cpp0% | 17% | 22% | 20% | 39%
h0% | 0% | 9% | 45% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ArchivedSamples3% | 11% | 36% | 22% | 25%
ErrorList23% | 15% | 10% | 22% | 27%
Code_Sweep2% | 4% | 39% | 24% | 28%
SqliteVisualizer0% | 24% | 48% | 11% | 15%
Editor_With_Toolbox0% | 32% | 22% | 26% | 17%
Combo_Box0% | 35% | 58% | 5% | <1%
MSDNSearch0% | 42% | 0% | 29% | 27%
WPFDesigner_XML0% | 10% | 37% | 26% | 25%
Backwards_Compatible_AsyncPackage_20130% | 43% | 0% | 33% | 22%
CodeLensOopSample0% | 0% | 51% | 27% | 20%
ROOT0% | 0% | 24% | 20% | 55%
Ook_Language_Integration0% | 0% | 32% | 23% | 43%
AsyncCompletion0% | 0% | 49% | 20% | 30%
LanguageServerProtocol0% | 0% | 24% | 29% | 45%
Diff_Classifier0% | 0% | 56% | 0% | 43%
Reference_Services0% | 0% | 26% | 32% | 40%
Highlight_Word0% | 0% | 35% | 40% | 24%
Menu_And_Commands0% | 0% | 30% | 39% | 30%
AsyncQuickInfo0% | 0% | 70% | 0% | 29%
Open_Folder_Extensibility0% | 0% | 23% | 27% | 49%
Typing_Speed_Meter0% | 0% | 26% | 12% | 60%
Intra-text_Adornment0% | 0% | 10% | 32% | 57%
Options0% | 0% | 18% | 25% | 55%
OperationProgress0% | 0% | 0% | 41% | 58%
LightBulb0% | 0% | 0% | 33% | 66%
VisibilityConstraints0% | 0% | 0% | 77% | 22%
Caret_Fish_Eye0% | 0% | 0% | 69% | 30%
SingleFileGenerator0% | 0% | 0% | 60% | 40%
Backwards_Compatible_Editor_Command0% | 0% | 0% | 19% | 80%
AsyncToolWindow0% | 0% | 0% | 20% | 80%
Todo_Classification0% | 0% | 0% | 22% | 77%
CustomCommand0% | 0% | 0% | 45% | 54%
Completion_Tooltip_Customization0% | 0% | 0% | 64% | 35%
AsyncPackageMigration0% | 0% | 0% | 0% | 100%
Windows_Forms_Controls_Installer0% | 0% | 0% | 0% | 100%
SolutionLoadEvents0% | 0% | 0% | 0% | 100%
ProtocolHandler0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public int QueryEditFiles()
in ArchivedSamples/Source_Control_Provider_Status_Bar_Integration/C#/SccProviderService.cs
135 22 7
public int QueryEditFiles()
in ArchivedSamples/Source_Code_Control_Provider/C#/SccProviderService.cs
134 22 7
private void DoUpdate()
in ErrorList/C#/SpellChecker.cs
113 23 0
public int GetColumn()
in Code_Sweep/C#/VsPackage/TaskProvider.cs
109 6 2
HBITMAP CDpiHelper::CreateDeviceFromLogicalImage()
in ArchivedSamples/High-DPI_Images_Icons/Cpp/VsUIDpiHelper.cpp
95 17 3
private bool TryGetRow()
in SqliteVisualizer/SqliteVisualizer/SqliteFuncEvalQuery.cs
89 10 1
HIMAGELIST CDpiHelper::CreateDeviceFromLogicalImage()
in ArchivedSamples/High-DPI_Images_Icons/Cpp/VsUIDpiHelper.cpp
80 13 2
public int OnQueryRemoveFiles()
in ArchivedSamples/Source_Code_Control_Provider/C#/SccProviderService.cs
79 15 6
public int OnQueryRemoveFiles()
in ArchivedSamples/Source_Control_Provider_Status_Bar_Integration/C#/SccProviderService.cs
79 15 6
public override bool TryGetValue()
in ErrorList/C#/SpellingErrorsSnapshot.cs
76 16 3
public int QueryStatus()
in Editor_With_Toolbox/CS/EditorPane.cs
72 15 4
private IList GetSelectedNodes()
in ArchivedSamples/Source_Code_Control_Provider/C#/SccProvider.cs
71 10 0
private IList GetSelectedNodes()
in ArchivedSamples/Source_Control_Provider_Status_Bar_Integration/C#/SccProvider.cs
71 10 0
void RSSDownloadComplete()
in MSDNSearch/C#/MSDNSearch/MSDNSearchTask.cs
71 15 2
public int CreateEditorInstance()
in WPFDesigner_XML/WPFDesigner_XML/EditorFactory.cs
70 7 11
public override void Register()
in Backwards_Compatible_AsyncPackage_2013/BackwardsCompatibleAsyncPackage/AsyncPackageHelpers/AsyncPackageRegistrationAttribute.cs
69 14 1
private void OnMenuMyDynamicCombo()
in Combo_Box/C#/VsPkg.cs
66 14 2
public int QuerySaveFiles()
in ArchivedSamples/Source_Code_Control_Provider/C#/SccProviderService.cs
64 14 6
public int QuerySaveFiles()
in ArchivedSamples/Source_Control_Provider_Status_Bar_Integration/C#/SccProviderService.cs
64 14 6
private static void GetFieldInfo()
in ArchivedSamples/Single_File_Generator/C#/SourceCodeGenerator.cs
61 12 6