McPringle/sportchef

View on GitHub

Showing 86 of 86 total issues

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

    @PUT
    public Response update(@Valid final Event event, @Context final UriInfo info) {
        find(); // only update existing events
        final Event eventToUpdate = event.toBuilder()
                .eventId(eventId)
src/main/java/ch/sportchef/business/user/boundary/UserResource.java on lines 55..64

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 67.

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
    public void findByEventIdFound() {
        // arrange
        final EventRepository eventRepository = new EventRepository();
        final Event event = createEvent(eventRepository);
src/test/java/ch/sportchef/business/user/control/UserRepositoryTest.java on lines 79..91

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 59.

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
    public void findByUserIdFound() {
        // arrange
        final UserRepository userRepository = new UserRepository();
        final User user = createUser(userRepository);
src/test/java/ch/sportchef/business/event/control/EventRepositoryTest.java on lines 83..95

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 59.

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 searchForError has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private Error searchForError(@NotNull final Throwable cause) {
        Error error = null;

        if (cause instanceof ConcurrentModificationException) {
            error = new Error(CONFLICT, cause);
Severity: Minor
Found in src/main/java/ch/sportchef/business/RuntimeExceptionMapper.java - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    @Test
    public void toStringTest() {
        // arrange
        final String toStringExpect = String.format(
                "User(userId=%d, firstName=%s, lastName=%s, phone=%s, email=%s, role=%s, version=%d)",
Severity: Minor
Found in src/test/java/ch/sportchef/business/user/entity/UserTest.java and 1 other location - About 40 mins to fix
src/test/java/ch/sportchef/business/event/entity/EntityTest.java on lines 89..101

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 51.

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
    public void toStringTest() {
        // arrange
        final String toStringExpect = String.format(
                "Event(eventId=%d, title=%s, location=%s, date=%s, time=%s, cssBackgroundColor=%s, version=%d)",
src/test/java/ch/sportchef/business/user/entity/UserTest.java on lines 93..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 51.

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
    public void deleteExistingEvent() {
        // arrange
        final EventRepository eventRepository = new EventRepository();
        final Event event = createEvent(eventRepository);
src/test/java/ch/sportchef/business/user/control/UserRepositoryTest.java on lines 135..146

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 49.

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
    public void deleteExistingUser() {
        // arrange
        final UserRepository userRepository = new UserRepository();
        final User user = createUser(userRepository);
src/test/java/ch/sportchef/business/event/control/EventRepositoryTest.java on lines 139..150

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 49.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event event1 = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55

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 48.

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 9 locations. Consider refactoring.
Open

        final Event testEvent = Event.builder()
                .eventId(1L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 49..55
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 9 locations. Consider refactoring.
Open

        final Event eventToCreate = Event.builder()
                .eventId(0L)
                .title("Testevent")
                .location("Testlocation")
                .date(LocalDate.of(2099, Month.DECEMBER, 31))
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 63..69
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 95..101
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 128..134
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 146..152
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 164..170
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 186..192
src/test/java/ch/sportchef/business/event/boundary/EventResourceTest.java on lines 216..222
src/test/java/ch/sportchef/business/event/boundary/EventsResourceTest.java on lines 86..92

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 48.

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 crop has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static BufferedImage crop(final BufferedImage inputImage,
                                     final int startX, final int startY,
                                     final int outputWidth, final int outputHeight) {
Severity: Minor
Found in src/main/java/ch/sportchef/business/ImageResizer.java - About 35 mins to fix

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

    @Test
    public void deleteImageNotFound() {
        // arrange
        final Long eventId = 6L;
        final EventService eventServiceMock = mock(EventService.class);
src/test/java/ch/sportchef/business/event/control/EventImageServiceTest.java on lines 107..117

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 47.

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
    public void getImageNotFound() throws IOException {
        // arrange
        final Long eventId = 2L;
        final EventService eventServiceMock = mock(EventService.class);
src/test/java/ch/sportchef/business/event/control/EventImageServiceTest.java on lines 170..180

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 47.

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

Severity
Category
Status
Source
Language