Covivo/mobicoop

View on GitHub

Showing 1,607 of 1,615 total issues

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

            if (count($matching['request']->getAsks())) {
                foreach ($matching['request']->getAsks() as $ask) {
                    switch ($ask->getStatus()) {
                        case Ask::STATUS_INITIATED:
                            $item->setInitiatedAsk(true);
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ResultManager.php on lines 1888..1946

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

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 (count($matching['offer']->getAsks())) {
                foreach ($matching['offer']->getAsks() as $ask) {
                    switch ($ask->getStatus()) {
                        case Ask::STATUS_INITIATED:
                            $item->setInitiatedAsk(true);
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ResultManager.php on lines 1314..1372

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

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

                                case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_SHORTEST:
                                    usort($cmatches, self::build_sorter('newDistance'));
                                    $matching = new Matching();
                                    $matching->setProposalOffer($this->proposalRepository->find($candidateDriverId));
                                    $matching->setProposalRequest($this->proposalRepository->find($candidatePassengerId));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1159..1178

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

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

                                case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
                                    usort($cmatches, self::build_sorter('newDuration'));
                                    $matching = new Matching();
                                    $matching->setProposalOffer($this->proposalRepository->find($candidateDriverId));
                                    $matching->setProposalRequest($this->proposalRepository->find($candidatePassengerId));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1180..1199

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

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 (!is_null($relayPoint->getAddress())) {
            $address = new Address();
            $address->setStreetAddress($relayPoint->getAddress()->getStreetAddress());
            $address->setPostalCode($relayPoint->getAddress()->getPostalCode());
            $address->setAddressLocality($relayPoint->getAddress()->getAddressLocality());
Severity: Major
Found in api/src/RelayPoint/Admin/Service/RelayPointManager.php and 1 other location - About 1 day to fix
api/src/Event/Admin/Service/EventManager.php on lines 89..109

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

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 (!is_null($event->getAddress())) {
            $address = new Address();
            $address->setStreetAddress($event->getAddress()->getStreetAddress());
            $address->setPostalCode($event->getAddress()->getPostalCode());
            $address->setAddressLocality($event->getAddress()->getAddressLocality());
Severity: Major
Found in api/src/Event/Admin/Service/EventManager.php and 1 other location - About 1 day to fix
api/src/RelayPoint/Admin/Service/RelayPointManager.php on lines 109..129

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

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

                        switch ($day) {
                            case 'sun':
                                $arrivalHourToNextOrigin = $sameDayProposal->getCriteria()->getArrivalSunTime()->add(new DateInterval('PT'.$travelDurationBetweenProposalDestinationAndAdOrigin.'S'));

                                break;
Severity: Major
Found in api/src/Carpool/Service/AntiFraudManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/AntiFraudManager.php on lines 261..296

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

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

            switch ($day) {
                case 'sun':
                    $arrivalHourToNextOrigin = $sameDayProposal->getCriteria()->getArrivalSunTime()->add(new DateInterval('PT'.$travelDurationBetweenProposalDestinationAndAdOrigin.'S'));

                    break;
Severity: Major
Found in api/src/Carpool/Service/AntiFraudManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/AntiFraudManager.php on lines 318..353

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

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

Direction has 65 functions (exceeds 20 allowed). Consider refactoring.
Open

class Direction
{
    public const DEFAULT_ID = 999999999999;

    /**
Severity: Major
Found in api/src/Geography/Entity/Direction.php - About 1 day to fix

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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    Severity: Major
    Found in api/src/User/Filter/ODRangeOriginFilter.php and 1 other location - About 1 day to fix
    api/src/User/Filter/ODRangeDestinationFilter.php on lines 1..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 276.

    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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    Severity: Major
    Found in api/src/User/Filter/ODRangeDestinationFilter.php and 1 other location - About 1 day to fix
    api/src/User/Filter/ODRangeOriginFilter.php on lines 1..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 276.

    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

                $result = PeliasAddress::createFromArray([
                    'providedBy' => $this->getName(),
                    'latitude' => $location['geometry']['coordinates'][1],
                    'longitude' => $location['geometry']['coordinates'][0],
                    'bounds' => $bounds,
    Severity: Major
    Found in api/src/Geography/ProviderFactory/PeliasSearch.php and 1 other location - About 1 day to fix
    api/src/Geography/ProviderFactory/PeliasAutocomplete.php on lines 186..199

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

    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

                $result = PeliasAddress::createFromArray([
                    'providedBy' => $this->getName(),
                    'latitude' => $location['geometry']['coordinates'][1],
                    'longitude' => $location['geometry']['coordinates'][0],
                    'bounds' => $bounds,
    Severity: Major
    Found in api/src/Geography/ProviderFactory/PeliasAutocomplete.php and 1 other location - About 1 day to fix
    api/src/Geography/ProviderFactory/PeliasSearch.php on lines 187..200

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

    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

    <?php
    
    /**
     * Copyright (c) 2021, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/Stats/Security/IndicatorVoter.php and 1 other location - About 1 day to fix
    api/src/Stats/Admin/Security/AnalyticVoter.php on lines 1..89

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

    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

    <?php
    
    /**
     * Copyright (c) 2022, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/Stats/Admin/Security/AnalyticVoter.php and 1 other location - About 1 day to fix
    api/src/Stats/Security/IndicatorVoter.php on lines 1..90

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

    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

    <?php
    /**
     * Copyright (c) 2022, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    Severity: Major
    Found in api/src/User/Filter/CardLetterFilter.php and 1 other location - About 1 day to fix
    api/src/User/Filter/RezoKitFilter.php on lines 1..80

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

    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

                            case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
                                usort($matchesPassenger, self::build_sorter('newDuration'));
                                $matching = new Matching();
                                $matching->setProposalOffer($this->proposalRepository->find($candidateId));
                                $matching->setProposalRequest($proposal);
    Severity: Major
    Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 1 day to fix
    api/src/Carpool/Service/ProposalMatcher.php on lines 569..588

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

    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

                            case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_SHORTEST:
                                usort($matchesDriver, self::build_sorter('newDistance'));
                                $matching = new Matching();
                                $matching->setProposalOffer($proposal);
                                $matching->setProposalRequest($this->proposalRepository->find($candidateId));
    Severity: Major
    Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 1 day to fix
    api/src/Carpool/Service/ProposalMatcher.php on lines 495..514

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

    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

    <?php
    /**
     * Copyright (c) 2022, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    Severity: Major
    Found in api/src/User/Filter/RezoKitFilter.php and 1 other location - About 1 day to fix
    api/src/User/Filter/CardLetterFilter.php on lines 1..80

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

    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

                            case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
                                usort($matchesDriver, self::build_sorter('newDuration'));
                                $matching = new Matching();
                                $matching->setProposalOffer($proposal);
                                $matching->setProposalRequest($this->proposalRepository->find($candidateId));
    Severity: Major
    Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 1 day to fix
    api/src/Carpool/Service/ProposalMatcher.php on lines 516..535

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

    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