aws / aws-xray-java-agent
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 191 units with 1,523 lines of code in units (59.1% of code).
    • 1 very long units (136 lines of code)
    • 2 long units (147 lines of code)
    • 11 medium size units (272 lines of code)
    • 24 small units (353 lines of code)
    • 153 very small units (615 lines of code)
8% | 9% | 17% | 23% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java8% | 9% | 17% | 23% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config33% | 23% | 5% | 21% | 17%
aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers0% | 9% | 38% | 26% | 24%
aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/listeners0% | 0% | 44% | 28% | 26%
aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime0% | 0% | 43% | 25% | 31%
aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/models0% | 0% | 0% | 35% | 64%
aws-xray-agent-benchmark/src/jmh/java/com/amazonaws/xray/agent/utils0% | 0% | 0% | 23% | 76%
aws-xray-agent-benchmark/src/jmh/java/com/amazonaws/xray/agent/benchmark0% | 0% | 0% | 27% | 72%
aws-xray-agent-benchmark/src/jmh/java/com/amazonaws/xray/agent/benchmark/source0% | 0% | 0% | 0% | 100%
aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/dispatcher0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void init()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config/XRaySDKConfiguration.java
136 33 1
public AgentConfiguration()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config/AgentConfiguration.java
95 20 1
public void handleResponse()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/AWSV2Handler.java
52 13 1
private HashMap extractRequestParameters()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/AWSV2Handler.java
31 12 1
private HashMap extractResponseParameters()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/AWSV2Handler.java
31 12 1
private static void addResponseInformation()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/HttpClientHandler.java
29 8 2
public void handleResponse()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/upstream/ServletHandler.java
25 6 1
public Listener generateListener()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/listeners/XRayListenerFactory.java
23 6 0
public void handleRequest()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/upstream/ServletHandler.java
23 3 1
private void initInterceptorManifest()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/AWSV2Handler.java
23 4 1
protected Segment beginSegment()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/XRayHandler.java
22 5 3
public void handleRequest()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/SqlHandler.java
22 6 1
static URL getConfigFile()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/AgentRuntimeLoader.java
22 6 0
public boolean equals()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config/AgentConfiguration.java
21 19 1
public String toString()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config/AgentConfiguration.java
20 1 0
public void endSubsegment()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/models/XRayTransactionContext.java
19 5 1
protected boolean getSamplingDecision()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/XRayHandler.java
19 3 1
public AgentConfiguration()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config/AgentConfiguration.java
18 1 0
public static Server create()
in aws-xray-agent-benchmark/src/jmh/java/com/amazonaws/xray/agent/utils/SimpleJettyServer.java
17 3 2
private AgentConfiguration parseConfig()
in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/config/XRaySDKConfiguration.java
17 4 1