microsoft / elastic-db-tools-for-java
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,760 units with 12,102 lines of code in units (71.2% of code).
    • 2 very long units (326 lines of code)
    • 4 long units (246 lines of code)
    • 76 medium size units (2,301 lines of code)
    • 222 small units (3,112 lines of code)
    • 1,456 very small units (6,117 lines of code)
2% | 2% | 19% | 25% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java2% | 2% | 19% | 25% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
shard/recovery38% | 0% | 27% | 16% | 18%
shard/storeops0% | 3% | 19% | 22% | 54%
shard/sqlstore0% | 11% | 30% | 25% | 33%
shard/mapper0% | 9% | 29% | 20% | 41%
shard/base0% | 0% | 21% | 21% | 56%
query/multishard0% | 0% | 15% | 23% | 60%
shard/mapmanager0% | 0% | 16% | 37% | 46%
shard/utils0% | 0% | 21% | 15% | 62%
shard/map0% | 0% | 8% | 68% | 23%
core/commons0% | 0% | 11% | 19% | 68%
shard/schema0% | 0% | 15% | 29% | 54%
shard/store0% | 0% | 8% | 12% | 78%
query/exception0% | 0% | 0% | 8% | 91%
query/logging0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static ArrayList compareRangeMappings()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/recovery/MappingComparisonUtils.java
172 15 3
public List detectMappingDifferences()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/recovery/RecoveryManager.java
154 24 2
private List getMappingsToPurge()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/recovery/ReplaceMappingsGlobalOperation.java
67 11 1
public static StoreResults newInstance()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/sqlstore/SqlResults.java
66 19 1
protected final Connection openConnectionForKey()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/mapper/BaseShardMapper.java
61 16 5
public final StoreResults doOperation()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/base/StoreOperation.java
52 10 0
public final StoreResults doGlobal()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/base/StoreOperationGlobal.java
50 11 0
private List getMappingsToPurge()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/recovery/ReplaceMappingsLocalOperation.java
49 9 1
public int compareTo()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/base/ShardKey.java
48 12 1
private Callable getLabeledResultSetTask()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/query/multishard/MultiShardStatement.java
47 5 4
private MultiShardException validateResultSet()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/query/multishard/MultiShardStatement.java
47 10 2
public ShardKey getNextKey()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/base/ShardKey.java
46 12 0
public static ShardManagementException onShardMapperErrorGlobal()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/base/StoreOperationErrorHandler.java
46 14 6
public static void validateMapping()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/base/ValidationUtils.java
45 6 4
private static ShardMapManager createSqlShardMapManagerImpl()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/mapmanager/ShardMapManagerFactory.java
43 5 5
public void rebuildMappingsOnShard()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/recovery/RecoveryManager.java
41 6 2
public final RangeMapping merge()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/mapper/RangeShardMapper.java
40 6 4
private Stream executeAsync()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/query/multishard/MultiShardStatement.java
39 6 3
public ShardManagementException onStoreException()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/storeops/base/StoreOperation.java
39 31 2
protected final List getMappingsForRange()
in elastic-db-tools/src/main/java/com/microsoft/azure/elasticdb/shard/mapper/BaseShardMapper.java
38 10 6