microsoft / jschema
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 364 units with 5,411 lines of code in units (66.5% of code).
    • 2 very long units (277 lines of code)
    • 9 long units (582 lines of code)
    • 68 medium size units (2,081 lines of code)
    • 95 small units (1,421 lines of code)
    • 190 very small units (1,050 lines of code)
5% | 10% | 38% | 26% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs5% | 10% | 38% | 26% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Json.Schema.ToDotNet4% | 9% | 39% | 27% | 17%
src/Json.Schema12% | 19% | 15% | 26% | 26%
src/Json.Schema.ToDotNet.Cli0% | 75% | 0% | 15% | 9%
src/Json.Schema.Validation0% | 0% | 64% | 21% | 14%
src/Json.Schema.Validation.Cli0% | 0% | 63% | 18% | 17%
src/Json.Pointer0% | 0% | 23% | 41% | 35%
src/Json.Schema.TestUtilities0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void AddPropertyInfoFromPropertySchema()
in src/Json.Schema.ToDotNet/PropertyInfoDictionary.cs
146 18 4
private static JsonSchema Collapse()
in src/Json.Schema/JsonSchema.cs
131 24 2
public JsonSchema()
in src/Json.Schema/JsonSchema.cs
92 20 1
internal string GenerateClass()
in src/Json.Schema.ToDotNet/DataModelGenerator.cs
72 6 2
private IfStatementSyntax MakeDictionaryEqualsTest()
in src/Json.Schema.ToDotNet/EqualityComparerGenerator.cs
72 1 3
private static int Run()
in src/Json.Schema.ToDotNet.Cli/Program.cs
63 6 1
public string Generate()
in src/Json.Schema.ToDotNet/DataModelGenerator.cs
62 11 1
public bool Equals()
in src/Json.Schema/JsonSchema.cs
61 43 1
public override object ReadJson()
in src/Json.Schema/SchemaTypeConverter.cs
55 8 4
private StatementSyntax GenerateCollectionElementInitialization()
in src/Json.Schema.ToDotNet/ClassGenerator.cs
54 1 3
private ConstructorDeclarationSyntax GenerateCopyConstructor()
in src/Json.Schema.ToDotNet/ClassGenerator.cs
51 1 0
public override BaseTypeDeclarationSyntax GenerateTypeDeclaration()
in src/Json.Schema.ToDotNet/ClassGenerator.cs
49 6 0
49 1 1
private StatementSyntax GenerateDictionaryHashCodeContribution()
in src/Json.Schema.ToDotNet/EqualityComparerGenerator.cs
49 1 1
private MemberDeclarationSyntax GenerateVisitActualMethod()
in src/Json.Schema.ToDotNet/RewritingVisitorGenerator.cs
46 1 0
private void ValidateToken()
in src/Json.Schema.Validation/Validator.cs
46 12 2
internal static SyntaxTriviaList MakeDocComment()
in src/Json.Schema.ToDotNet/SyntaxHelper.cs
45 7 4
private void ValidateNumber()
in src/Json.Schema.Validation/Validator.cs
45 14 2
private TypeSyntax MakeDictionaryType()
in src/Json.Schema.ToDotNet/PropertyInfoDictionary.cs
44 2 4
43 1 2