awslabs / disco
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 612 units with 3,989 lines of code in units (58.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (59 lines of code)
    • 22 medium size units (581 lines of code)
    • 65 small units (948 lines of code)
    • 524 very small units (2,401 lines of code)
0% | 1% | 14% | 23% | 60%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 1% | 14% | 23% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
disco-java-agent-web0% | 25% | 12% | 30% | 31%
disco-java-agent0% | 0% | 12% | 16% | 70%
disco-java-agent-instrumentation-preprocess0% | 0% | 28% | 48% | 23%
disco-java-agent-aws0% | 0% | 9% | 34% | 56%
disco-java-agent-sql0% | 0% | 20% | 46% | 33%
disco-java-agent-example0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static void service()
in disco-java-agent-web/src/main/java/software/amazon/disco/agent/web/servlet/HttpServletServiceInterceptor.java
59 8 4
public PreprocessConfig parseCommandLine()
in disco-java-agent-instrumentation-preprocess/src/main/java/software/amazon/disco/instrumentation/preprocess/cli/PreprocessConfigParser.java
42 15 1
protected OptionToMatch matchArgWithFlag()
in disco-java-agent-instrumentation-preprocess/src/main/java/software/amazon/disco/instrumentation/preprocess/cli/PreprocessConfigParser.java
37 15 3
public AgentConfig parseCommandLine()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/config/AgentConfigParser.java
35 10 1
static void processJarFile()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/plugin/PluginDiscovery.java
34 8 3
public static void scan()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/plugin/PluginDiscovery.java
29 7 2
public static Object intercept()
in disco-java-agent-web/src/main/java/software/amazon/disco/agent/web/apache/httpclient/ApacheHttpClientInterceptor.java
29 6 3
public void testStaticInstrumentationOnThreadSubclassInterceptorWorks()
in disco-java-agent-instrumentation-preprocess/src/integtest/java/software/amazon/disco/instrumentation/preprocess/ThreadSubclassInterceptorIntegTest.java
29 4 0
public static Set processInstallables()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/plugin/PluginDiscovery.java
26 8 0
protected Path moveTempFileToDestination()
in disco-java-agent-instrumentation-preprocess/src/main/java/software/amazon/disco/instrumentation/preprocess/export/JarExportStrategy.java
26 6 3
public static Collection apply()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/plugin/PluginDiscovery.java
24 9 0
static boolean loadJar()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/plugin/PluginDiscovery.java
24 7 3
public Collection install()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/DiscoAgentTemplate.java
24 6 3
public static ServiceDownstreamRequestEvent enter()
in disco-java-agent-aws/src/main/java/software/amazon/disco/agent/awsv1/AWSClientInvokeInterceptor.java
24 4 1
public static ServiceRequestEvent enter()
in disco-java-agent-sql/src/main/java/software/amazon/disco/agent/sql/JdbcExecuteInterceptor.java
23 4 3
public static Collection provideAllForkJoinTasks()
in disco-java-agent/disco-java-agent-core/src/integ/java/software/amazon/disco/agent/integtest/concurrent/source/TestForkJoinTaskFactory.java
23 4 0
public void testSubmitRunnableNestedWhenExecutorReusesThread()
in disco-java-agent/disco-java-agent-core/src/integ/java/software/amazon/disco/agent/integtest/concurrent/ExecutorServiceTests.java
23 5 0
public Statement apply()
in disco-java-agent/disco-java-agent-core/src/integ/java/software/amazon/disco/agent/integtest/concurrent/source/ForceConcurrency.java
22 5 2
static void processInstallableClasses()
in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/plugin/PluginDiscovery.java
22 7 4
protected JarInfo loadJar()
in disco-java-agent-instrumentation-preprocess/src/main/java/software/amazon/disco/instrumentation/preprocess/loaders/classfiles/JarLoader.java
22 6 2