microsoft / CDM
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 7,067 units with 81,398 lines of code in units (74.2% of code).
    • 48 very long units (6,589 lines of code)
    • 211 long units (14,813 lines of code)
    • 717 medium size units (22,188 lines of code)
    • 1,055 small units (15,353 lines of code)
    • 5,036 very small units (22,455 lines of code)
8% | 18% | 27% | 18% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs14% | 20% | 28% | 18% | 17%
java6% | 16% | 23% | 17% | 35%
ts6% | 20% | 30% | 18% | 24%
py1% | 14% | 26% | 21% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
CSharp/Microsoft.CommonDataModel.ObjectModel15% | 20% | 27% | 18% | 17%
Java/objectmodel6% | 16% | 23% | 17% | 35%
TypeScript/Cdm9% | 17% | 29% | 17% | 25%
TypeScript/Persistence7% | 25% | 40% | 13% | 12%
Python/cdm1% | 14% | 26% | 21% | 35%
TypeScript/ResolvedModel0% | 33% | 21% | 19% | 25%
TypeScript/Utilities0% | 22% | 27% | 19% | 30%
CSharp/Microsoft.CommonDataModel.ObjectModel.Adapter.Syms0% | 24% | 27% | 23% | 24%
CSharp/Microsoft.CommonDataModel.ObjectModel.Adapter.Adls0% | 11% | 39% | 24% | 23%
TypeScript/Storage0% | 0% | 33% | 35% | 31%
CSharp/Microsoft.CommonDataModel.ObjectModel.Telemetry0% | 0% | 56% | 25% | 18%
TypeScript/Enums0% | 0% | 79% | 20% | 0%
Python0% | 0% | 0% | 79% | 20%
TypeScript0% | 0% | 0% | 32% | 67%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public async Task CreateResolvedEntityAsync()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Cdm/CdmEntityDefinition.cs
386 73 4
internal CdmObjectBase ResolveSymbolReference()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Cdm/CdmCorpusDefinition.cs
236 67 5
public CdmObjectBase resolveSymbolReference()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmCorpusDefinition.java
217 67 5
internal override ResolvedAttributeSetBuilder ConstructResolvedAttributes()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Cdm/CdmEntityAttributeDefinition.cs
181 34 2
private List GetApplierGeneratedAttributes()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/ResolvedModel/ResolvedAttributeSetBuilder.cs
173 44 3
public async static Task ToData()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Persistence/ModelJson/ManifestPersistence.cs
170 32 3
internal async Task SaveDocumentAsAsync()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Persistence/PersistenceLayer.cs
168 37 4
public ResolvedAttributeSetBuilder constructResolvedAttributes()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmEntityAttributeDefinition.java
165 39 2
public async createResolvedEntityAsync()
in objectModel/TypeScript/Cdm/CdmEntityDefinition.ts
155 29 4
public static CompletableFuture toData()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/persistence/modeljson/ManifestPersistence.java
146 29 3
public CompletableFuture createResolvedEntityAsync()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmEntityDefinition.java
144 25 4
public CdmAttributeResolutionGuidance combineResolutionGuidance()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmAttributeResolutionGuidance.java
143 35 1
public MakeObject()
in objectModel/TypeScript/Cdm/CdmCorpusDefinition.ts
143 45 3
public T MakeObject()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Cdm/CdmCorpusDefinition.cs
141 45 3
public T makeObject()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmCorpusDefinition.java
141 45 3
public static CompletableFuture fromObject()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/persistence/modeljson/ManifestPersistence.java
140 19 3
public constructResolvedAttributes()
in objectModel/TypeScript/Cdm/CdmEntityAttributeDefinition.ts
140 34 2
internal bool PruneToScope()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Cdm/CdmAttributeContext.cs
137 36 1
public static async Task FromObject()
in objectModel/CSharp/Microsoft.CommonDataModel.ObjectModel/Persistence/ModelJson/ManifestPersistence.cs
133 22 3
public CompletableFuture createResolvedManifestAsync()
in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmManifestDefinition.java
133 21 3