dropwizard/dropwizard

View on GitHub

Showing 869 of 869 total issues

File BaseConfigurationFactoryTest.java has 350 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package io.dropwizard.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.benmanes.caffeine.cache.CaffeineSpec;
import io.dropwizard.jackson.Jackson;

    File HealthCheckManagerTest.java has 348 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package io.dropwizard.health;
    
    import com.codahale.metrics.Counter;
    import com.codahale.metrics.MetricRegistry;
    import com.codahale.metrics.health.HealthCheck;

      File FileAppenderFactoryTest.java has 346 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package io.dropwizard.logging;
      
      import ch.qos.logback.classic.AsyncAppender;
      import ch.qos.logback.classic.Logger;
      import ch.qos.logback.classic.LoggerContext;

        File SelfValidationTest.java has 343 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package io.dropwizard.validation;
        
        import ch.qos.logback.classic.Level;
        import ch.qos.logback.classic.Logger;
        import ch.qos.logback.classic.LoggerContext;

          DataSizeTest has 33 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class DataSizeTest {
              @Test
              void convertsToPetabytes() {
                  assertThat(DataSize.petabytes(2).toPetabytes())
                          .isEqualTo(2);
          Severity: Minor
          Found in dropwizard-util/src/test/java/io/dropwizard/util/DataSizeTest.java - About 4 hrs to fix

            JerseyClientBuilderTest has 33 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class JerseyClientBuilderTest {
                private final MetricRegistry metricRegistry = new MetricRegistry();
                private final JerseyClientBuilder builder = new JerseyClientBuilder(metricRegistry);
                private final LifecycleEnvironment lifecycleEnvironment = spy(new LifecycleEnvironment(metricRegistry));
                private final Environment environment = mock(Environment.class);

              File JerseyClientBuilderTest.java has 338 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package io.dropwizard.client;
              
              import com.codahale.metrics.MetricRegistry;
              import com.codahale.metrics.httpclient.HttpClientMetricNameStrategies;
              import com.codahale.metrics.httpclient.HttpClientMetricNameStrategy;

                DataSize has 32 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class DataSize implements Comparable<DataSize>, Serializable {
                    private static final long serialVersionUID = 8517642678733072800L;
                
                    private static final Pattern SIZE_PATTERN = Pattern.compile("(\\d+)\\s*(\\S*)");
                    private static final SortedMap<String, DataSizeUnit> SUFFIXES;
                Severity: Minor
                Found in dropwizard-util/src/main/java/io/dropwizard/util/DataSize.java - About 4 hrs to fix

                  TlsConfiguration has 32 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class TlsConfiguration {
                  
                      @NotEmpty
                      private String protocol = "TLSv1.2";
                  
                  

                    File CliTest.java has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    package io.dropwizard.cli;
                    
                    import io.dropwizard.Application;
                    import io.dropwizard.Configuration;
                    import io.dropwizard.setup.Bootstrap;
                    Severity: Minor
                    Found in dropwizard-core/src/test/java/io/dropwizard/cli/CliTest.java - About 3 hrs to fix

                      AssetServletTest has 30 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class AssetServletTest {
                          private static final String DUMMY_SERVLET = "/dummy_servlet/";
                          private static final String NOINDEX_SERVLET = "/noindex_servlet/";
                          private static final String NOCHARSET_SERVLET = "/nocharset_servlet/";
                          private static final String NOMEDIATYPE_SERVLET = "/nomediatype_servlet/";

                        File ValidatingResource.java has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        package io.dropwizard.jersey.validation;
                        
                        import io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.Example;
                        import io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.ListExample;
                        import io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.Partial1;

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              @Test
                              void shouldRescheduleCheckForHealthyDependency() {
                                  final String name = "test";
                                  final Schedule schedule = new Schedule();
                                  final ScheduledFuture future = mock(ScheduledFuture.class);
                          dropwizard-health/src/test/java/io/dropwizard/health/HealthCheckSchedulerTest.java on lines 107..138

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 223.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              @Test
                              void supportsFinalByteRange() throws Exception {
                                  request.setURI(ROOT_SERVLET + "assets/example.txt");
                                  request.setHeader(HttpHeader.RANGE.asString(), "bytes=10-10");
                                  response = HttpTester.parseResponse(SERVLET_TESTER.getResponses(request
                          dropwizard-servlets/src/test/java/io/dropwizard/servlets/assets/AssetServletTest.java on lines 355..377

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 223.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              @Test
                              void supportsMultipleByteRanges() throws Exception {
                                  request.setURI(ROOT_SERVLET + "assets/example.txt");
                                  request.setHeader(HttpHeader.RANGE.asString(), "bytes=0-0,-1");
                                  response = HttpTester.parseResponse(SERVLET_TESTER.getResponses(request
                          dropwizard-servlets/src/test/java/io/dropwizard/servlets/assets/AssetServletTest.java on lines 307..329

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 223.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              @Test
                              void shouldRescheduleCheckForUnhealthyDependency() {
                                  final String name = "test";
                                  final Schedule schedule = new Schedule();
                                  final ScheduledFuture future = mock(ScheduledFuture.class);
                          dropwizard-health/src/test/java/io/dropwizard/health/HealthCheckSchedulerTest.java on lines 74..105

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 223.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Method configureSslContextFactory has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected SslContextFactory configureSslContextFactory(SslContextFactory factory) {
                                  if (keyStorePath != null) {
                                      factory.setKeyStorePath(keyStorePath);
                                  }
                          
                          

                            Method configure has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public void configure(Subparser subparser) {
                                    super.configure(subparser);
                            
                                    subparser.addArgument("-o", "--output")

                              Method testBuild has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Test
                                  void testBuild() throws Exception {
                                      final HttpsConnectorFactory https = new HttpsConnectorFactory();
                                      https.setBindHost("127.0.0.1");
                                      https.setPort(8443);

                                File HttpClientBuilder.java has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                package io.dropwizard.client;
                                
                                import com.codahale.metrics.MetricRegistry;
                                import com.codahale.metrics.httpclient.HttpClientMetricNameStrategies;
                                import com.codahale.metrics.httpclient.HttpClientMetricNameStrategy;
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language