florianschmitt/connection-backend

View on GitHub

Showing 67 of 67 total issues

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

    fun requestCanceledInformVolunteer(request: ERequest) {
        request.acceptedByVolunteer ?: throw NullPointerException("request.acceptedByVolunteer cannot be null")

        val subjectTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_CANCELED_INFORM_VOLUNTEER_SUBJECT)
        val contentTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_CANCELED_INFORM_VOLUNTEER_CONTENT)
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/MailService.kt and 2 other locations - About 3 hrs to fix
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 50..60
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 86..96

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

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

    fun requestAcceptedConfirmationForVolunteer(request: ERequest) {
        request.acceptedByVolunteer ?: throw NullPointerException("request.acceptedByVolunteer cannot be null")

        val subjectTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_ACCEPTED_VOLUNTEER_SUBJECT)
        val contentTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_ACCEPTED_VOLUNTEER_CONTENT)
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/MailService.kt and 2 other locations - About 3 hrs to fix
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 74..84
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 86..96

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

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

    fun requestFinishedInformVolunteer(request: ERequest) {
        request.acceptedByVolunteer ?: throw NullPointerException("request.acceptedByVolunteer cannot be null")

        val subjectTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_FINISHED_ASK_FEEDBACK_VOLUNTEER_SUBJECT)
        val contentTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_FINISHED_ASK_FEEDBACK_VOLUNTEER_CONTENT)
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/MailService.kt and 2 other locations - About 3 hrs to fix
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 50..60
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 74..84

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

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

    fun requestConfirmation(request: ERequest) {
        val subjectTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_CONFIRMATION_SUBJECT)
        val contentTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_CONFIRMATION_CONTENT)

        val subject = stringTemplateService.replace(subjectTemplate, request.requesterName!!, request)
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/MailService.kt and 2 other locations - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 30..38
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 98..106

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

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

    fun requestFinishedInformRequester(request: ERequest) {
        val subjectTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_FINISHED_ASK_FEEDBACK_REQUESTER_SUBJECT)
        val contentTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_FINISHED_ASK_FEEDBACK_REQUESTER_CONTENT)

        val subject = stringTemplateService.replace(subjectTemplate, request.requesterName!!, request)
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/MailService.kt and 2 other locations - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 20..28
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 30..38

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

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

    fun requestExpired(request: ERequest) {
        val subjectTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_EXPIRED_REQUESTER_SUBJECT)
        val contentTemplate = templateService.getTemplate(TemplateFixtures.REQUEST_EXPIRED_REQUESTER_CONTENT)

        val subject = stringTemplateService.replace(subjectTemplate, request.requesterName!!, request)
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/MailService.kt and 2 other locations - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 20..28
src/main/kotlin/de/florianschmitt/service/MailService.kt on lines 98..106

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

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

    private fun addSerboCroatic() {
        val l = ELanguage("SERBOCROATIAN", 2)

        val l1 = ELocalized(l, ELocalizedLanguageEnum.DE, "Serbo-Kroatisch")
        val l2 = ELocalized(l, ELocalizedLanguageEnum.AR, "اللغة التركية")
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 40..49
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 51..60
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 73..82

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

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

    private fun addEnglish() {
        val l = ELanguage("ENGLISH", 5)

        val l1 = ELocalized(l, ELocalizedLanguageEnum.DE, "Englisch")
        val l2 = ELocalized(l, ELocalizedLanguageEnum.AR, "العربية")
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 40..49
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 51..60
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 62..71

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

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

    private fun addTurkish() {
        val l = ELanguage("TURKISH", 1)

        val l1 = ELocalized(l, ELocalizedLanguageEnum.DE, "Türkisch")
        val l2 = ELocalized(l, ELocalizedLanguageEnum.AR, "اللغة التركية")
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 40..49
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 62..71
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 73..82

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

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

    private fun addArabic() {
        val l = ELanguage("ARABIC", 0)

        val l1 = ELocalized(l, ELocalizedLanguageEnum.DE, "Arabisch")
        val l2 = ELocalized(l, ELocalizedLanguageEnum.AR, "العربية")
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 51..60
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 62..71
src/main/kotlin/de/florianschmitt/service/data/AddDefaultLanguagesRunner.kt on lines 73..82

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

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

    @GetMapping(path = ["/feedbackvolunteer/{requestIdentifier}"])
    @ResponseStatus(HttpStatus.OK)
    fun hasVolunteerFeedback(@PathVariable(name = "requestIdentifier") requestIdentifier: String):
            ResponseEntity<Result> {
        val result = feedbackVolunteerService.findFeedback(requestIdentifier) != null
Severity: Major
Found in src/main/kotlin/de/florianschmitt/rest/FeedbackController.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/rest/FeedbackController.kt on lines 31..37

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

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

    @GetMapping(path = ["/feedbackrequester/{requestIdentifier}"])
    @ResponseStatus(HttpStatus.OK)
    fun hasRequesterFeedback(@PathVariable(name = "requestIdentifier") requestIdentifier: String):
            ResponseEntity<Result> {
        val result = feedbackService.findFeedback(requestIdentifier) != null
Severity: Major
Found in src/main/kotlin/de/florianschmitt/rest/FeedbackController.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/rest/FeedbackController.kt on lines 46..52

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

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

package de.florianschmitt.model.entities

enum class EOccasionEnum(private val label: String)
{
    DOCTOR("Arzt"),
src/main/kotlin/de/florianschmitt/model/entities/ERequestStateEnum.kt on lines 1..15

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

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

package de.florianschmitt.model.entities

enum class ERequestStateEnum(private val label: String) {
    OPEN("offen"),
    ACCEPTED("angenommen"),
src/main/kotlin/de/florianschmitt/model/entities/EOccasionEnum.kt on lines 1..15

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

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

    @Transactional
    fun finishRequest(request: ERequest) {
        request.state = ERequestStateEnum.FINISHED
        val requestSaved = repository.save(request)

Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/RequestService.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/RequestService.kt on lines 48..58

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

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

    @Transactional
    fun expireRequest(request: ERequest) {
        request.state = ERequestStateEnum.EXPIRED
        val requestSaved = repository.save(request)

Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/RequestService.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/RequestService.kt on lines 60..70

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

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

    @Query(value = "Select r From ERequest r Where r.state = 'OPEN' And r.datetime Is Not Null And ((r.datetime between :startDate and :endDate) or r.datetime < :startDate)")
    @EntityGraph(attributePaths = ["languages"])
    fun findOpenRequestsWhichAreDue(@Param("startDate") startDate: LocalDateTime, @Param("endDate") endDate: LocalDateTime): Collection<ERequest>
src/main/kotlin/de/florianschmitt/repository/RequestRepository.kt on lines 31..33

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

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

    @Query(value = "Select r From ERequest r Where r.state = 'ACCEPTED' And r.datetime Is Not Null And ((r.datetime Between :startDate And :endDate) or r.datetime < :startDate)")
    @EntityGraph(attributePaths = ["languages"])
    fun findAcceptedRequestsWhichAreDue(@Param("startDate") startDate: LocalDateTime, @Param("endDate") endDate: LocalDateTime): Collection<ERequest>
src/main/kotlin/de/florianschmitt/repository/RequestRepository.kt on lines 27..29

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

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

    private fun map(source: ERequestDTO): ERequest {
        val result = mapper.map(source, ERequest::class.java)

        result.languages = source.languageIds
                ?.mapNotNull { languageRepository.findById(it).orElse(null) }
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/util/DTOMapper.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/util/DTOMapper.kt on lines 84..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 148.

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

    private fun map(source: EVolunteerDTO): EVolunteer {
        val result = mapper.map(source, EVolunteer::class.java)

        result.languages = source.languageIds
                ?.mapNotNull { languageRepository.findById(it).orElse(null) }
Severity: Major
Found in src/main/kotlin/de/florianschmitt/service/util/DTOMapper.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/de/florianschmitt/service/util/DTOMapper.kt on lines 61..69

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

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