Spring Boot
Unit Size

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 13,913 units with 80,388 lines of code in units (61.4% of code).
    • 1 very long units (180 lines of code)
    • 6 long units (340 lines of code)
    • 233 medium size units (6,293 lines of code)
    • 1,489 small units (20,778 lines of code)
    • 12,184 very small units (52,797 lines of code)
<1% | <1% | 7% | 25% | 65%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
java<1% | <1% | 7% | 25% | 65%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Logical Component
primary logical decomposition
spring-boot-project/spring-boot<1% | <1% | 10% | 26% | 62%
spring-boot-project/spring-boot-autoconfigure0% | <1% | 5% | 20% | 73%
spring-boot-project/spring-boot-cli0% | 2% | 9% | 34% | 54%
spring-boot-project/spring-boot-tools0% | <1% | 9% | 30% | 59%
buildSrc/src0% | 0% | 14% | 34% | 50%
spring-boot-project/spring-boot-actuator0% | 0% | 3% | 21% | 75%
spring-boot-project/spring-boot-devtools0% | 0% | 7% | 34% | 57%
spring-boot-project/spring-boot-actuator-autoconfigure0% | 0% | 2% | 14% | 83%
spring-boot-project/spring-boot-properties-migrator0% | 0% | 0% | 68% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
static
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java
180 1 0
private void execute()
in spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java
70 7 2
private void load()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
56 14 5
protected FailureAnalysis analyze()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzer.java
55 17 3
URI generateUrl()
in spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java
54 15 1
protected ProjectGenerationRequest createProjectGenerationRequest()
in spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitCommand.java
53 16 1
protected final MatchResult getMatchingBeans()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
52 12 2
private void configureProperties()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
49 1 2
static
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TldSkipPatterns.java
49 1 0
private List tokenize()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/BasicJsonParser.java
48 14 1
private Object readLiteral()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java
44 13 0
private String getProperty()
in spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
44 11 3
private static String parseStringValue()
in spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java
42 8 4
void upgradeDependencies()
in buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java
42 7 0
private boolean defaultElementEquals()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
41 14 3
static
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TldSkipPatterns.java
41 1 0
public void start()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyWebServer.java
41 9 0
List load()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedPropertiesLoader.java
41 11 1
public ConfigurableApplicationContext run()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
40 4 1
ConfigDataEnvironmentContributors withProcessedImports()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java
40 7 2
public void customize()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
39 1 1
public ConditionOutcome getMatchOutcome()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java
39 8 2
private int nextCleanInternal()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java
39 12 0
private JSONObject readObject()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java
39 13 0
private static List getUrlsFromManifestClassPathAttribute()
in spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java
39 8 2
private boolean dashIgnoringElementEquals()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
39 10 3
protected void prepareContext()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
39 7 2
private void documentMojo()
in buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/DocumentPluginGoals.java
39 3 2
protected ProjectType determineProjectType()
in spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java
38 9 1
Elements parse()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
38 9 1
private void string()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java
37 11 1
private List getNestedArchives()
in spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
37 16 1
protected void configure()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java
36 9 3
private SourceOptions()
in spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/SourceOptions.java
36 10 2
void documentConfigurationProperties()
in buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java
36 1 0
public void effectiveBomArtifact()
in buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java
36 2 0
private DeploymentManager createManager()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java
35 6 1
private RabbitConnectionFactoryBean getRabbitConnectionFactoryBean()
in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
34 2 3
private ConfigurationMetadataHint parseHint()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/JsonReader.java
34 7 1
private ResourceManager getDocumentRootResourceManager()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java
34 7 0
public void start()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java
34 6 0
protected final D nullSafeValue()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java
34 11 2
void postProcess()
in buildSrc/src/main/java/org/springframework/boot/build/log4j2/ReproducibleLog4j2PluginsDatAction.java
34 6 1
private JSONArray readArray()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java
33 10 0
public static Object wrap()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java
33 19 1
public ExitStatus run()
in spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java
33 9 1
protected abstract E createEndpoint()
in spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
33 4 4
Builder createBuilder()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServerFactoryDelegate.java
33 10 1
protected void mergeItemMetadata()
in spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java
32 9 1
protected void configure()
in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java
32 9 1