Covivo/mobicoop

View on GitHub
api/src/Carpool/Service/ProposalMatcher.php

Summary

Maintainability
F
1 mo
Test Coverage

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

                if (isset($matching->getFilters()['pickup']['minPickupTime'], $matching->getFilters()['pickup']['maxPickupTime'])) {
                    if (Criteria::FREQUENCY_PUNCTUAL == $matching->getProposalOffer()->getCriteria()->getFrequency()) {
                        $matchingCriteria->setMinTime($matching->getProposalOffer()->getCriteria()->getMinTime());
                        $matchingCriteria->setMaxTime($matching->getProposalOffer()->getCriteria()->getMaxTime());
                        $matchingCriteria->setMarginDuration($matching->getProposalOffer()->getCriteria()->getMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 days to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 762..827

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

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 (isset($matching->getFilters()['pickup']['minPickupTime'], $matching->getFilters()['pickup']['maxPickupTime'])) {
                if (Criteria::FREQUENCY_PUNCTUAL == $matching->getProposalOffer()->getCriteria()->getFrequency()) {
                    $matchingCriteria->setMinTime($matching->getProposalOffer()->getCriteria()->getMinTime());
                    $matchingCriteria->setMaxTime($matching->getProposalOffer()->getCriteria()->getMaxTime());
                    $matchingCriteria->setMarginDuration($matching->getProposalOffer()->getCriteria()->getMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 days to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1328..1393

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

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

            foreach ($proposals as $proposalToMatch) {
                // if the candidate is not passenger we skip (the 2 candidates could be driver AND passenger, and the second one match only as a driver)
                if (!$proposalToMatch['passenger']) {
                    continue;
                }
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 2 days to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 439..479

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

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

            foreach ($proposals as $proposalToMatch) {
                // if the candidate is not driver we skip (the 2 candidates could be driver AND passenger, and the second one match only as a passenger)
                if (!$proposalToMatch['driver']) {
                    continue;
                }
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 2 days to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 380..422

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

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

                        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

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

                        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($matchesPassenger, self::build_sorter('newDistance'));
                            $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 548..567

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

                        if ($proposal1->getCriteria()->isThuCheck() && 4 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getThuTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getThuMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getThuMaxTime();
                            $pickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1718..1734
api/src/Carpool/Service/ProposalMatcher.php on lines 1735..1751
api/src/Carpool/Service/ProposalMatcher.php on lines 1752..1768
api/src/Carpool/Service/ProposalMatcher.php on lines 1786..1802
api/src/Carpool/Service/ProposalMatcher.php on lines 1803..1819
api/src/Carpool/Service/ProposalMatcher.php on lines 1820..1836

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

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

                        if ($proposal1->getCriteria()->isWedCheck() && 3 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getWedTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getWedMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getWedMaxTime();
                            $pickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1718..1734
api/src/Carpool/Service/ProposalMatcher.php on lines 1735..1751
api/src/Carpool/Service/ProposalMatcher.php on lines 1769..1785
api/src/Carpool/Service/ProposalMatcher.php on lines 1786..1802
api/src/Carpool/Service/ProposalMatcher.php on lines 1803..1819
api/src/Carpool/Service/ProposalMatcher.php on lines 1820..1836

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

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

                        if ($proposal1->getCriteria()->isSunCheck() && 0 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getSunTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getSunMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getSunMaxTime();
                            $pickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1718..1734
api/src/Carpool/Service/ProposalMatcher.php on lines 1735..1751
api/src/Carpool/Service/ProposalMatcher.php on lines 1752..1768
api/src/Carpool/Service/ProposalMatcher.php on lines 1769..1785
api/src/Carpool/Service/ProposalMatcher.php on lines 1786..1802
api/src/Carpool/Service/ProposalMatcher.php on lines 1803..1819

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

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

                        if ($proposal1->getCriteria()->isTueCheck() && 2 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getTueTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getTueMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getTueMaxTime();
                            $pickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1718..1734
api/src/Carpool/Service/ProposalMatcher.php on lines 1752..1768
api/src/Carpool/Service/ProposalMatcher.php on lines 1769..1785
api/src/Carpool/Service/ProposalMatcher.php on lines 1786..1802
api/src/Carpool/Service/ProposalMatcher.php on lines 1803..1819
api/src/Carpool/Service/ProposalMatcher.php on lines 1820..1836

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

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

                        if ($proposal1->getCriteria()->isMonCheck() && 1 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getMonTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getMonMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getMonMaxTime();
                            $pickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1735..1751
api/src/Carpool/Service/ProposalMatcher.php on lines 1752..1768
api/src/Carpool/Service/ProposalMatcher.php on lines 1769..1785
api/src/Carpool/Service/ProposalMatcher.php on lines 1786..1802
api/src/Carpool/Service/ProposalMatcher.php on lines 1803..1819
api/src/Carpool/Service/ProposalMatcher.php on lines 1820..1836

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

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

                        if ($proposal1->getCriteria()->isFriCheck() && 5 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getFriTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getFriMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getFriMaxTime();
                            $minPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1718..1734
api/src/Carpool/Service/ProposalMatcher.php on lines 1735..1751
api/src/Carpool/Service/ProposalMatcher.php on lines 1752..1768
api/src/Carpool/Service/ProposalMatcher.php on lines 1769..1785
api/src/Carpool/Service/ProposalMatcher.php on lines 1803..1819
api/src/Carpool/Service/ProposalMatcher.php on lines 1820..1836

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

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

                        if ($proposal1->getCriteria()->isSatCheck() && 6 == $proposal2->getCriteria()->getFromDate()->format('w')) {
                            $pickupTime = clone $proposal1->getCriteria()->getSatTime();
                            $minPickupTime = clone $proposal1->getCriteria()->getSatMinTime();
                            $maxPickupTime = clone $proposal1->getCriteria()->getSatMaxTime();
                            $pickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1718..1734
api/src/Carpool/Service/ProposalMatcher.php on lines 1735..1751
api/src/Carpool/Service/ProposalMatcher.php on lines 1752..1768
api/src/Carpool/Service/ProposalMatcher.php on lines 1769..1785
api/src/Carpool/Service/ProposalMatcher.php on lines 1786..1802
api/src/Carpool/Service/ProposalMatcher.php on lines 1820..1836

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

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

                        if ($proposal1->getCriteria()->isTueCheck() && $proposal2->getCriteria()->isTueCheck()) {
                            $tuePickupTime = clone $proposal1->getCriteria()->getTueTime();
                            $tueMinPickupTime = clone $proposal1->getCriteria()->getTueMinTime();
                            $tueMaxPickupTime = clone $proposal1->getCriteria()->getTueMaxTime();
                            $tuePickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1841..1857
api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

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

                        if ($proposal1->getCriteria()->isThuCheck() && $proposal2->getCriteria()->isThuCheck()) {
                            $thuPickupTime = clone $proposal1->getCriteria()->getThuTime();
                            $thuMinPickupTime = clone $proposal1->getCriteria()->getThuMinTime();
                            $thuMaxPickupTime = clone $proposal1->getCriteria()->getThuMaxTime();
                            $thuPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1841..1857
api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

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

                        if ($proposal1->getCriteria()->isMonCheck() && $proposal2->getCriteria()->isMonCheck()) {
                            $monPickupTime = clone $proposal1->getCriteria()->getMonTime();
                            $monMinPickupTime = clone $proposal1->getCriteria()->getMonMinTime();
                            $monMaxPickupTime = clone $proposal1->getCriteria()->getMonMaxTime();
                            $monPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

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

                        if ($proposal1->getCriteria()->isSatCheck() && $proposal2->getCriteria()->isSatCheck()) {
                            $satPickupTime = clone $proposal1->getCriteria()->getSatTime();
                            $satMinPickupTime = clone $proposal1->getCriteria()->getSatMinTime();
                            $satMaxPickupTime = clone $proposal1->getCriteria()->getSatMaxTime();
                            $satPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1841..1857
api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

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

                        if ($proposal1->getCriteria()->isWedCheck() && $proposal2->getCriteria()->isWedCheck()) {
                            $wedPickupTime = clone $proposal1->getCriteria()->getWedTime();
                            $wedMinPickupTime = clone $proposal1->getCriteria()->getWedMinTime();
                            $wedMaxPickupTime = clone $proposal1->getCriteria()->getWedMaxTime();
                            $wedPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1841..1857
api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

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

                        if ($proposal1->getCriteria()->isSunCheck() && $proposal2->getCriteria()->isSunCheck()) {
                            $sunPickupTime = clone $proposal1->getCriteria()->getSunTime();
                            $sunMinPickupTime = clone $proposal1->getCriteria()->getSunMinTime();
                            $sunMaxPickupTime = clone $proposal1->getCriteria()->getSunMaxTime();
                            $sunPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1841..1857
api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942

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

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

                        if ($proposal1->getCriteria()->isFriCheck() && $proposal2->getCriteria()->isFriCheck()) {
                            $friPickupTime = clone $proposal1->getCriteria()->getFriTime();
                            $friMinPickupTime = clone $proposal1->getCriteria()->getFriMinTime();
                            $friMaxPickupTime = clone $proposal1->getCriteria()->getFriMaxTime();
                            $friPickupTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 6 other locations - About 7 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1841..1857
api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

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

                        [
                            'id' => $proposalFound['wid'],
                            'position' => $proposalFound['position'],
                            'destination' => $proposalFound['destination'],
                            'reached' => $proposalFound['reached'],
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 320..342

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

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

                $element = [
                    'id' => $proposalFound['wid'],
                    'position' => $proposalFound['position'],
                    'destination' => $proposalFound['destination'],
                    'reached' => $proposalFound['reached'],
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 294..316

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

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

                                        [
                                            'position' => $proposalFound['position'],
                                            'destination' => $proposalFound['destination'],
                                            'latitude' => $proposalFound['latitude'],
                                            'longitude' => $proposalFound['longitude'],
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1069..1088

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

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

                                $element = [
                                    'position' => $proposalFound['position'],
                                    'destination' => $proposalFound['destination'],
                                    'latitude' => $proposalFound['latitude'],
                                    'longitude' => $proposalFound['longitude'],
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1046..1065

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

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

            (Criteria::FREQUENCY_PUNCTUAL == $proposal->getCriteria()->getFrequency() && $proposal->getUseTime())
                || (Criteria::FREQUENCY_REGULAR == $proposal->getCriteria()->getFrequency() && (
                    ($proposal->getCriteria()->isMonCheck() && $proposal->getCriteria()->getMonTime())
                    || ($proposal->getCriteria()->isTueCheck() && $proposal->getCriteria()->getTueTime())
                    || ($proposal->getCriteria()->isWedCheck() && $proposal->getCriteria()->getWedTime())
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1247..1256

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

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

                    (Criteria::FREQUENCY_PUNCTUAL == $proposal->getCriteria()->getFrequency() && $proposal->getCriteria()->getFromTime())
                        || (Criteria::FREQUENCY_REGULAR == $proposal->getCriteria()->getFrequency() && (
                            ($proposal->getCriteria()->isMonCheck() && $proposal->getCriteria()->getMonTime())
                            || ($proposal->getCriteria()->isTueCheck() && $proposal->getCriteria()->getTueTime())
                            || ($proposal->getCriteria()->isWedCheck() && $proposal->getCriteria()->getWedTime())
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 601..610

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

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 ($matches = $this->geoMatcher->forceMatch($candidateDriver, $candidatePassenger)) {
            // many matches can be found for 2 candidates : if multiple routes satisfy the criteria
            if (is_array($matches) && count($matches) > 0) {
                switch (self::MULTI_MATCHES_FOR_SAME_CANDIDATES) {
                    case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 227..249

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

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 ($matches = $this->geoMatcher->forceMatch($candidateDriver, $candidatePassenger)) {
            // many matches can be found for 2 candidates : if multiple routes satisfy the criteria
            if (is_array($matches) && count($matches) > 0) {
                switch (self::MULTI_MATCHES_FOR_SAME_CANDIDATES) {
                    case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 159..181

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

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

                foreach ($matching->getFilters()['route'] as $key => $point) {
                    $waypoint = new Waypoint();
                    $waypoint->setPosition($key);
                    $waypoint->setDestination(false);
                    if ($key == (count($matching->getFilters()['route']) - 1)) {
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 619..630

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

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

            foreach ($matching->getFilters()['route'] as $key => $point) {
                $waypoint = new Waypoint();
                $waypoint->setPosition($key);
                $waypoint->setDestination(false);
                if ($key == (count($matching->getFilters()['route']) - 1)) {
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 1281..1292

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

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

            if (isset($matching->getFilters()['pickup']['thuMinPickupTime'], $matching->getFilters()['pickup']['thuMaxPickupTime'])) {
                $matchingCriteria->setThuCheck(true);
                $matchingCriteria->setThuMinTime($matching->getProposalOffer()->getCriteria()->getThuMinTime());
                $matchingCriteria->setThuMaxTime($matching->getProposalOffer()->getCriteria()->getThuMaxTime());
                $matchingCriteria->setThuMarginDuration($matching->getProposalOffer()->getCriteria()->getThuMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['monMinPickupTime'], $matching->getFilters()['pickup']['monMaxPickupTime'])) {
                    $matchingCriteria->setMonCheck(true);
                    $matchingCriteria->setMonMinTime($matching->getProposalOffer()->getCriteria()->getMonMinTime());
                    $matchingCriteria->setMonMaxTime($matching->getProposalOffer()->getCriteria()->getMonMaxTime());
                    $matchingCriteria->setMonMarginDuration($matching->getProposalOffer()->getCriteria()->getMonMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['friMinPickupTime'], $matching->getFilters()['pickup']['friMaxPickupTime'])) {
                    $matchingCriteria->setFriCheck(true);
                    $matchingCriteria->setFriMinTime($matching->getProposalOffer()->getCriteria()->getFriMinTime());
                    $matchingCriteria->setFriMaxTime($matching->getProposalOffer()->getCriteria()->getFriMaxTime());
                    $matchingCriteria->setFriMarginDuration($matching->getProposalOffer()->getCriteria()->getFriMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['tueMinPickupTime'], $matching->getFilters()['pickup']['tueMaxPickupTime'])) {
                    $matchingCriteria->setTueCheck(true);
                    $matchingCriteria->setTueMinTime($matching->getProposalOffer()->getCriteria()->getTueMinTime());
                    $matchingCriteria->setTueMaxTime($matching->getProposalOffer()->getCriteria()->getTueMaxTime());
                    $matchingCriteria->setTueMarginDuration($matching->getProposalOffer()->getCriteria()->getTueMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['thuMinPickupTime'], $matching->getFilters()['pickup']['thuMaxPickupTime'])) {
                    $matchingCriteria->setThuCheck(true);
                    $matchingCriteria->setThuMinTime($matching->getProposalOffer()->getCriteria()->getThuMinTime());
                    $matchingCriteria->setThuMaxTime($matching->getProposalOffer()->getCriteria()->getThuMaxTime());
                    $matchingCriteria->setThuMarginDuration($matching->getProposalOffer()->getCriteria()->getThuMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['satMinPickupTime'], $matching->getFilters()['pickup']['satMaxPickupTime'])) {
                $matchingCriteria->setSatCheck(true);
                $matchingCriteria->setSatMinTime($matching->getProposalOffer()->getCriteria()->getSatMinTime());
                $matchingCriteria->setSatMaxTime($matching->getProposalOffer()->getCriteria()->getSatMaxTime());
                $matchingCriteria->setSatMarginDuration($matching->getProposalOffer()->getCriteria()->getSatMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['wedMinPickupTime'], $matching->getFilters()['pickup']['wedMaxPickupTime'])) {
                $matchingCriteria->setWedCheck(true);
                $matchingCriteria->setWedMinTime($matching->getProposalOffer()->getCriteria()->getWedMinTime());
                $matchingCriteria->setWedMaxTime($matching->getProposalOffer()->getCriteria()->getWedMaxTime());
                $matchingCriteria->setWedMarginDuration($matching->getProposalOffer()->getCriteria()->getWedMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['friMinPickupTime'], $matching->getFilters()['pickup']['friMaxPickupTime'])) {
                $matchingCriteria->setFriCheck(true);
                $matchingCriteria->setFriMinTime($matching->getProposalOffer()->getCriteria()->getFriMinTime());
                $matchingCriteria->setFriMaxTime($matching->getProposalOffer()->getCriteria()->getFriMaxTime());
                $matchingCriteria->setFriMarginDuration($matching->getProposalOffer()->getCriteria()->getFriMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['monMinPickupTime'], $matching->getFilters()['pickup']['monMaxPickupTime'])) {
                $matchingCriteria->setMonCheck(true);
                $matchingCriteria->setMonMinTime($matching->getProposalOffer()->getCriteria()->getMonMinTime());
                $matchingCriteria->setMonMaxTime($matching->getProposalOffer()->getCriteria()->getMonMaxTime());
                $matchingCriteria->setMonMarginDuration($matching->getProposalOffer()->getCriteria()->getMonMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['sunMinPickupTime'], $matching->getFilters()['pickup']['sunMaxPickupTime'])) {
                $matchingCriteria->setSunCheck(true);
                $matchingCriteria->setSunMinTime($matching->getProposalOffer()->getCriteria()->getSunMinTime());
                $matchingCriteria->setSunMaxTime($matching->getProposalOffer()->getCriteria()->getSunMaxTime());
                $matchingCriteria->setSunMarginDuration($matching->getProposalOffer()->getCriteria()->getSunMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['sunMinPickupTime'], $matching->getFilters()['pickup']['sunMaxPickupTime'])) {
                    $matchingCriteria->setSunCheck(true);
                    $matchingCriteria->setSunMinTime($matching->getProposalOffer()->getCriteria()->getSunMinTime());
                    $matchingCriteria->setSunMaxTime($matching->getProposalOffer()->getCriteria()->getSunMaxTime());
                    $matchingCriteria->setSunMarginDuration($matching->getProposalOffer()->getCriteria()->getSunMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435

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

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

                if (isset($matching->getFilters()['pickup']['wedMinPickupTime'], $matching->getFilters()['pickup']['wedMaxPickupTime'])) {
                    $matchingCriteria->setWedCheck(true);
                    $matchingCriteria->setWedMinTime($matching->getProposalOffer()->getCriteria()->getWedMinTime());
                    $matchingCriteria->setWedMaxTime($matching->getProposalOffer()->getCriteria()->getWedMaxTime());
                    $matchingCriteria->setWedMarginDuration($matching->getProposalOffer()->getCriteria()->getWedMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['satMinPickupTime'], $matching->getFilters()['pickup']['satMaxPickupTime'])) {
                    $matchingCriteria->setSatCheck(true);
                    $matchingCriteria->setSatMinTime($matching->getProposalOffer()->getCriteria()->getSatMinTime());
                    $matchingCriteria->setSatMaxTime($matching->getProposalOffer()->getCriteria()->getSatMaxTime());
                    $matchingCriteria->setSatMarginDuration($matching->getProposalOffer()->getCriteria()->getSatMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['tueMinPickupTime'], $matching->getFilters()['pickup']['tueMaxPickupTime'])) {
                $matchingCriteria->setTueCheck(true);
                $matchingCriteria->setTueMinTime($matching->getProposalOffer()->getCriteria()->getTueMinTime());
                $matchingCriteria->setTueMaxTime($matching->getProposalOffer()->getCriteria()->getTueMaxTime());
                $matchingCriteria->setTueMarginDuration($matching->getProposalOffer()->getCriteria()->getTueMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

    private function print_mem($id)
    {
        // Currently used memory
        $mem_usage = memory_get_usage();

Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 2 other locations - About 55 mins to fix
api/src/Geography/RouterProvider/GraphhopperProvider.php on lines 751..760
api/src/Match/Service/MassImportManager.php on lines 1206..1215

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

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

        foreach ($proposal->getMatchingOffers() as $matchingOffer) {
            // here, $proposal == matchingOffer->getProposalRequest()
            $found = false;
            foreach ($matchings as $matching) {
                if ($matching->getProposalOffer()->getId() == $matchingOffer->getProposalOffer()->getId()) {
Severity: Minor
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 55 mins to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 939..958

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

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

        foreach ($proposal->getMatchingRequests() as $matchingRequest) {
            // here, $proposal == matchingRequest->getProposalOffer()
            $found = false;
            foreach ($matchings as $matching) {
                if ($matching->getProposalRequest()->getId() == $matchingRequest->getProposalRequest()->getId()) {
Severity: Minor
Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 55 mins to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 918..937

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

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

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

                            case 3:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getWedMinTime() && $minPickupTime <= $proposal2->getCriteria()->getWedMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getWedMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getWedMaxTime())
                                )) {
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 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 4:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getThuMinTime() && $minPickupTime <= $proposal2->getCriteria()->getThuMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getThuMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getThuMaxTime())
                                )) {
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 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 5:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getFriMinTime() && $minPickupTime <= $proposal2->getCriteria()->getFriMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getFriMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getFriMaxTime())
                                )) {
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 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 2:
                                if (!(
                                    ($minPickupTime >= $proposal2->getCriteria()->getTueMinTime() && $minPickupTime <= $proposal2->getCriteria()->getTueMaxTime())
                                    || ($maxPickupTime >= $proposal2->getCriteria()->getTueMinTime() && $maxPickupTime <= $proposal2->getCriteria()->getTueMaxTime())
                                )) {
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 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

There are no issues that match your filters.

Category
Status