microsoft / DACExtensions
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 802 units with 7,823 lines of code in units (12.8% of code).
    • 4 very long units (3,028 lines of code)
    • 0 long units (0 lines of code)
    • 20 medium size units (532 lines of code)
    • 160 small units (1,878 lines of code)
    • 618 very small units (2,385 lines of code)
38% | 0% | 6% | 24% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs38% | 0% | 6% | 24% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DacFxStronglyTypedModel48% | 0% | 0% | 21% | 30%
SampleTests0% | 0% | 45% | 24% | 29%
RuleTests0% | 0% | 38% | 36% | 24%
SampleConsoleApp0% | 0% | 37% | 40% | 22%
RuleSamples0% | 0% | 11% | 44% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static bool ImplementsType()
in DacFxStronglyTypedModel/ModelUtilityMethods.cs
1543 411 2
public static IEnumerable GetModelElementTypes()
in DacFxStronglyTypedModel/ModelUtilityMethods.cs
980 659 1
257 121 2
public static ISqlModelElement AdaptInstance()
in DacFxStronglyTypedModel/model.cs
248 120 1
public void TestStopDeployment()
in SampleTests/TestDeploymentStoppingContributor.cs
42 2 0
public static void Run()
in SampleConsoleApp/ModelEndToEnd.cs
39 2 0
public void TestDbLocationModifierForImport()
in SampleTests/TestDbLocationModifiers.cs
39 2 0
29 3 1
private void RunTableNameEndingInViewTest()
in RuleTests/RuleTestCases.cs
29 2 1
public void TestIncludePlanFiltererInDacpac()
in SampleTests/TestFiltering.cs
29 1 0
public static void SaveStringToFile()
in RuleTests/RuleTestUtils.cs
27 4 2
public void TestOperationalOptions()
in SampleTests/TestCreateIndexOperationalPropsModifier.cs
27 1 0
public void TestFilterPlanWhenPublishing()
in SampleTests/TestFiltering.cs
26 1 0
public override IList Analyze()
in RuleSamples/AvoidWaitForDelayRule.cs
24 3 1
public static void RunFilteringExample()
in SampleConsoleApp/ModelFilterExample.cs
24 1 0
private void LoadTestScripts()
in RuleTests/BaselinedRuleTest.cs
23 3 0
public void TestDbCreateDatabaseModifier()
in SampleTests/TestDbLocationModifiers.cs
23 1 0
private static void AnalyzeColumns()
in RuleSamples/InMemoryTableBin2CollationRule.cs
22 3 4
private void RunVerification()
in RuleTests/BaselinedRuleTest.cs
22 2 2
private void DumpErrors()
in RuleTests/RuleTest.cs
22 5 1