Covivo/mobicoop

View on GitHub

Showing 1,607 of 1,615 total issues

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

<?php

/**
 * Copyright (c) 2022, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Payment/Command/BankTransfersCommand.php and 2 other locations - About 45 mins to fix
api/src/Payment/Command/UnpaidReminderCommand.php on lines 1..37
api/src/UserRelaunch/Command/RelaunchCommand.php on lines 1..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 95.

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

<?php

namespace App\Payment\Command;

use App\Payment\Service\UnpaidReminderManager;
Severity: Major
Found in api/src/Payment/Command/UnpaidReminderCommand.php and 2 other locations - About 45 mins to fix
api/src/Payment/Command/BankTransfersCommand.php on lines 1..59
api/src/UserRelaunch/Command/RelaunchCommand.php on lines 1..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 95.

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

<?php

namespace App\UserRelaunch\Command;

use App\UserRelaunch\Service\RelaunchManager;
Severity: Major
Found in api/src/UserRelaunch/Command/RelaunchCommand.php and 2 other locations - About 45 mins to fix
api/src/Payment/Command/BankTransfersCommand.php on lines 1..59
api/src/Payment/Command/UnpaidReminderCommand.php on lines 1..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 95.

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

                    $input = trim(str_replace(
                        ',',
                        '',
                        trim($origin['houseNumber']).' '.trim($origin['street']).' '.trim($origin['postalCode']).' '.trim($origin['addressLocality'])
                    ));
Severity: Minor
Found in api/src/Match/Service/MassImportManager.php and 1 other location - About 45 mins to fix
api/src/Match/Service/MassImportManager.php on lines 240..244

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

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

        if ($notification->hasAlt()) {
            $this->pushManager->send($push, $this->altCommunicationFolder.$templateLanguage.$this->pushTemplatePath.$notification->getAction()->getName(), $bodyContext, $lang);
        } else {
            $this->pushManager->send($push, $this->communicationFolder.$templateLanguage.$this->pushTemplatePath.$notification->getAction()->getName(), $bodyContext, $lang);
        }
Severity: Minor
Found in api/src/Communication/Service/NotificationManager.php and 1 other location - About 45 mins to fix
api/src/Communication/Service/NotificationManager.php on lines 792..796

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

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

        if ($notification->hasAlt()) {
            $this->emailManager->send($email, $this->altCommunicationFolder.$templateLanguage.$this->emailTemplatePath.$notification->getAction()->getName(), $bodyContext, $lang);
        } else {
            $this->emailManager->send($email, $this->communicationFolder.$templateLanguage.$this->emailTemplatePath.$notification->getAction()->getName(), $bodyContext, $lang);
        }
Severity: Minor
Found in api/src/Communication/Service/NotificationManager.php and 1 other location - About 45 mins to fix
api/src/Communication/Service/NotificationManager.php on lines 1263..1267

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

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

            $input = trim(str_replace(
                ',',
                '',
                trim($destination['houseNumber']).' '.trim($destination['street']).' '.trim($destination['postalCode']).' '.trim($destination['addressLocality'])
            ));
Severity: Minor
Found in api/src/Match/Service/MassImportManager.php and 1 other location - About 45 mins to fix
api/src/Match/Service/MassImportManager.php on lines 272..276

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

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

    it("Should create an event", function () {
        let email = "driver@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/03.event.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

    it("Should connect and disconnect on the site", function() {
        let email = "first@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/01.user.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

    it("Should create a community", function () {
        let email = "driver@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/04.community.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/05.message.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

    it("Should accept a carpool", function () {
        let email = "driver@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/05.message.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

    it("Should delete account", function () {
        let email = "first@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/01.user.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

    it("Should refuse a carpool", function () {
        let email = "driver@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/05.message.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 2..8

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

    it("Should change profil picture", function () {
        let email = "first@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/01.user.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/03.event.js on lines 10..16
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

    it("Should create carpool event", function () {
        let email = "driver@user.com"
        let password = "Asefth123"

        cy.signIn(email, password)
Severity: Major
Found in client/cypress/integration/03.event.js and 7 other locations - About 40 mins to fix
client/cypress/integration/01.user.js on lines 13..19
client/cypress/integration/01.user.js on lines 21..27
client/cypress/integration/01.user.js on lines 29..35
client/cypress/integration/03.event.js on lines 2..8
client/cypress/integration/04.community.js on lines 2..8
client/cypress/integration/05.message.js on lines 2..8
client/cypress/integration/05.message.js on lines 10..17

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

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

    public function reverseQuery(ReverseQuery $query): Collection
    {
        $coordinates = $query->getCoordinates();
        $longitude = $coordinates->getLongitude();
        $latitude = $coordinates->getLatitude();
Severity: Minor
Found in api/src/Geography/ProviderFactory/PeliasSearch.php and 1 other location - About 40 mins to fix
api/src/Geography/ProviderFactory/PeliasAutocomplete.php on lines 94..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 94.

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

                            case 1:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getMonMinTime() && $minPickupTime <= $proposal2->getCriteria()->getMonMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getMonMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getMonMaxTime())
                                )) {
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 40 mins to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1618..1629
api/src/Carpool/Service/ProposalMatcher.php on lines 1644..1655
api/src/Carpool/Service/ProposalMatcher.php on lines 1657..1668
api/src/Carpool/Service/ProposalMatcher.php on lines 1670..1681
api/src/Carpool/Service/ProposalMatcher.php on lines 1683..1694
api/src/Carpool/Service/ProposalMatcher.php on lines 1696..1707

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

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

                            case 6:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getSatMinTime() && $minPickupTime <= $proposal2->getCriteria()->getSatMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getSatMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getSatMaxTime())
                                )) {
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 40 mins to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1618..1629
api/src/Carpool/Service/ProposalMatcher.php on lines 1631..1642
api/src/Carpool/Service/ProposalMatcher.php on lines 1644..1655
api/src/Carpool/Service/ProposalMatcher.php on lines 1657..1668
api/src/Carpool/Service/ProposalMatcher.php on lines 1670..1681
api/src/Carpool/Service/ProposalMatcher.php on lines 1683..1694

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

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

                            case 0:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getSunMinTime() && $minPickupTime <= $proposal2->getCriteria()->getSunMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getSunMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getSunMaxTime())
                                )) {
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 40 mins to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1631..1642
api/src/Carpool/Service/ProposalMatcher.php on lines 1644..1655
api/src/Carpool/Service/ProposalMatcher.php on lines 1657..1668
api/src/Carpool/Service/ProposalMatcher.php on lines 1670..1681
api/src/Carpool/Service/ProposalMatcher.php on lines 1683..1694
api/src/Carpool/Service/ProposalMatcher.php on lines 1696..1707

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

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

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

            if ($this->canNotify($ask->getUser(), $ask->getUserRelated())) {
                $ad = $this->askManager->getAskFromAd($ask->getId(), $ask->getUser()->getId());
                $ad->setSchedule($this->addSchedule($ad));
                $ask->setAd($ad);
                $this->notificationManager->notifies(AdMinorUpdatedEvent::NAME, $ask->getUser(), $object);
Severity: Minor
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 1 other location - About 40 mins to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 426..431

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

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