Showing 869 of 869 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
@Test
void isComparable() {
// both zero
assertThat(Size.bytes(0)).isEqualByComparingTo(Size.bytes(0));
assertThat(Size.bytes(0)).isEqualByComparingTo(Size.kilobytes(0));
- Read upRead up
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 5353.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
@Test
void isComparable() {
// both zero
assertThat(DataSize.bytes(0)).isEqualByComparingTo(DataSize.bytes(0));
assertThat(DataSize.bytes(0)).isEqualByComparingTo(DataSize.kilobytes(0));
- Read upRead up
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 5353.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File ConstraintViolationExceptionMapperTest.java
has 1100 lines of code (exceeds 250 allowed). Consider refactoring. Open
package io.dropwizard.jersey.validation;
import io.dropwizard.jersey.AbstractJerseyTest;
import io.dropwizard.jersey.DropwizardResourceConfig;
import io.dropwizard.jersey.jackson.JacksonMessageBodyProviderTest.Example;
Method isComparable
has 539 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Test
void isComparable() throws Exception {
// both zero
assertThat(Duration.nanoseconds(0)).isEqualByComparingTo(Duration.nanoseconds(0));
assertThat(Duration.nanoseconds(0)).isEqualByComparingTo(Duration.microseconds(0));
ConstraintViolationExceptionMapperTest
has 118 methods (exceeds 20 allowed). Consider refactoring. Open
class ConstraintViolationExceptionMapperTest extends AbstractJerseyTest {
private static final Locale DEFAULT_LOCALE = Locale.getDefault();
@Override
protected Application configure() {
File DurationTest.java
has 761 lines of code (exceeds 250 allowed). Consider refactoring. Open
package io.dropwizard.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
DataSourceFactory
has 84 methods (exceeds 20 allowed). Consider refactoring. Open
public class DataSourceFactory implements PooledDataSourceFactory {
private static final String DEFAULT_VALIDATION_QUERY = "/* Health Check */ SELECT 1";
@SuppressWarnings("UnusedDeclaration")
File HttpClientBuilderTest.java
has 635 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.InstrumentedHttpClientConnectionManager;
Method isComparable
has 275 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Test
void isComparable() {
// both zero
assertThat(DataSize.bytes(0)).isEqualByComparingTo(DataSize.bytes(0));
assertThat(DataSize.bytes(0)).isEqualByComparingTo(DataSize.kilobytes(0));
Method isComparable
has 275 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Test
void isComparable() {
// both zero
assertThat(Size.bytes(0)).isEqualByComparingTo(Size.bytes(0));
assertThat(Size.bytes(0)).isEqualByComparingTo(Size.kilobytes(0));
File DataSizeTest.java
has 590 lines of code (exceeds 250 allowed). Consider refactoring. Open
package io.dropwizard.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
HttpsConnectorFactory
has 62 methods (exceeds 20 allowed). Consider refactoring. Open
@JsonTypeName("https")
public class HttpsConnectorFactory extends HttpConnectorFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(HttpsConnectorFactory.class);
private static final AtomicBoolean LOGGED = new AtomicBoolean(false);
HttpClientBuilderTest
has 61 methods (exceeds 20 allowed). Consider refactoring. Open
class HttpClientBuilderTest {
static class CustomRequestExecutor extends HttpRequestExecutor {
}
static class CustomBuilder extends HttpClientBuilder {
HttpConnectorFactory
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
@JsonTypeName("http")
public class HttpConnectorFactory implements ConnectorFactory {
public static ConnectorFactory application() {
final HttpConnectorFactory factory = new HttpConnectorFactory();
factory.port = 8080;
AbstractServerFactory
has 57 methods (exceeds 20 allowed). Consider refactoring. Open
public abstract class AbstractServerFactory implements ServerFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(ServerFactory.class);
@Valid
@Nullable
File SizeTest.java
has 502 lines of code (exceeds 250 allowed). Consider refactoring. Open
package io.dropwizard.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
File DataSourceFactory.java
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
package io.dropwizard.db;
import com.codahale.metrics.MetricRegistry;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
Similar blocks of code found in 2 locations. Consider refactoring. Open
package io.dropwizard.jersey.guava;
import com.google.common.base.Optional;
import io.dropwizard.jersey.AbstractJerseyTest;
import io.dropwizard.jersey.DropwizardResourceConfig;
- Read upRead up
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 488.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
package io.dropwizard.jersey.optional;
import io.dropwizard.jersey.AbstractJerseyTest;
import io.dropwizard.jersey.DropwizardResourceConfig;
import io.dropwizard.jersey.MyMessage;
- Read upRead up
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 488.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File HttpsConnectorFactory.java
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
package io.dropwizard.jetty;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.jetty9.InstrumentedConnectionFactory;
import com.fasterxml.jackson.annotation.JsonProperty;