Covivo/mobicoop

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

Summary

Maintainability
F
1 mo
Test Coverage

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

            } else {
                // the carpooler is driver or passenger
                $result->setMonCheck($result->getResultPassenger()->getOutward()->isMonCheck() || ($result->getResultPassenger()->getReturn() && $result->getResultPassenger()->getReturn()->isMonCheck()));
                $result->setTueCheck($result->getResultPassenger()->getOutward()->isTueCheck() || ($result->getResultPassenger()->getReturn() && $result->getResultPassenger()->getReturn()->isTueCheck()));
                $result->setWedCheck($result->getResultPassenger()->getOutward()->isWedCheck() || ($result->getResultPassenger()->getReturn() && $result->getResultPassenger()->getReturn()->isWedCheck()));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 4 days to fix
api/src/Carpool/Service/ResultManager.php on lines 555..641

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if ($result->getResultDriver() && !$result->getResultPassenger()) {
                // the carpooler is passenger only
                $result->setMonCheck($result->getResultDriver()->getOutward()->isMonCheck() || ($result->getResultDriver()->getReturn() && $result->getResultDriver()->getReturn()->isMonCheck()));
                $result->setTueCheck($result->getResultDriver()->getOutward()->isTueCheck() || ($result->getResultDriver()->getReturn() && $result->getResultDriver()->getReturn()->isTueCheck()));
                $result->setWedCheck($result->getResultDriver()->getOutward()->isWedCheck() || ($result->getResultDriver()->getReturn() && $result->getResultDriver()->getReturn()->isWedCheck()));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 4 days to fix
api/src/Carpool/Service/ResultManager.php on lines 598..641

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (!is_null($matching['request']->getPickUpDuration())) {
                $item->setOriginalDistance($matching['request']->getOriginalDistance());
                $item->setAcceptedDetourDistance($matching['request']->getAcceptedDetourDistance());
                $item->setNewDistance($matching['request']->getNewDistance());
                $item->setDetourDistance($matching['request']->getDetourDistance());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 days to fix
api/src/Carpool/Service/ResultManager.php on lines 1807..1835

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (!is_null($matching['offer']->getPickUpDuration())) {
                $item->setOriginalDistance($matching['offer']->getOriginalDistance());
                $item->setAcceptedDetourDistance($matching['offer']->getAcceptedDetourDistance());
                $item->setNewDistance($matching['offer']->getNewDistance());
                $item->setDetourDistance($matching['offer']->getDetourDistance());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 days to fix
api/src/Carpool/Service/ResultManager.php on lines 1232..1260

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

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 ($matching['offer']->getWaypoints() as $waypoint) {
                $curTime = null;
                if ($time) {
                    $curTime = clone $time;
                }
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ResultManager.php on lines 1189..1228

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

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 ($matching['request']->getWaypoints() as $waypoint) {
                $curTime = null;
                if ($time) {
                    $curTime = clone $time;
                }
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ResultManager.php on lines 1763..1802

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 289.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 289.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    private function getMatchingRegularDayAsOffer(Matching $matching, ResultItem $item): ?array
    {
        $proposal = $matching->getProposalOffer();
        $result = $this->getFirstCarpooledRegularDay($proposal, $matching->getProposalRequest(), 'offer');
        $item->setDate($result['date']);
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ResultManager.php on lines 2325..2375

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    private function getMatchingRegularDayAsRequest(Matching $matching, ResultItem $item): ?array
    {
        $proposal = $matching->getProposalRequest();
        $result = $this->getFirstCarpooledRegularDay($proposal, $matching->getProposalOffer(), 'request');
        $item->setDate($result['date']);
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/ResultManager.php on lines 2383..2433

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (is_null($result->getCarpooler())) {
                $carpooler = $matching['offer']->getProposalOffer()->getUser();
                // Clone doesn't treat avatars as it's a loadListener
                $resultCarpooler = clone $carpooler;
                $resultCarpooler->setAvatars($carpooler->getAvatars());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 849..870

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (is_null($result->getCarpooler())) {
                $carpooler = $matching['request']->getProposalRequest()->getUser();
                // Clone doesn't treat avatars as it's a loadListener
                $resultCarpooler = clone $carpooler;
                $resultCarpooler->setAvatars($carpooler->getAvatars());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1401..1422

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (Ad::ROLE_DRIVER == $role) {
                if (2 == $waypoint['candidate'] && '0' == $waypoint['position']) {
                    $item->setOrigin($waypoint['address']);
                    $item->setOriginPassenger($waypoint['address']);
                } elseif (2 == $waypoint['candidate'] && (int) $waypoint['position'] == $steps['carpooler']) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2741..2753

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

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

            } else {
                if (2 == $waypoint['candidate'] && '0' == $waypoint['position']) {
                    $item->setOrigin($waypoint['address']);
                    $item->setOriginPassenger($waypoint['address']);
                } elseif (2 == $waypoint['candidate'] && (int) $waypoint['position'] == $steps['requester']) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2729..2753

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if ($result->getResultDriver()) {
            if ($result->getResultDriver()->getOutward()) {
                if ($result->getResultDriver()->getOutward()->hasInitiatedAsk()) {
                    $result->setInitiatedAsk(true);
                }
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 688..711

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if ($result->getResultPassenger()) {
            if ($result->getResultPassenger()->getOutward()) {
                if ($result->getResultPassenger()->getOutward()->hasInitiatedAsk()) {
                    $result->setInitiatedAsk(true);
                }
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 5 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 664..687

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

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 ($matching['request']->getWaypoints() as $waypoint) {
                if (1 == $waypoint->getRole() && $waypoint->getPosition() > $destinations['requester']) {
                    $destinations['requester'] = $waypoint->getPosition();
                }
                if (1 == $waypoint->getRole() && $waypoint->getPosition() < $origins['requester']) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1747..1760

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

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 ($matching['offer']->getWaypoints() as $waypoint) {
                if (2 == $waypoint->getRole() && $waypoint->getPosition() > $destinations['requester']) {
                    $destinations['requester'] = $waypoint->getPosition();
                }
                if (2 == $waypoint->getRole() && $waypoint->getPosition() < $origins['requester']) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1173..1186

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if ($proposal->getCriteria()->getDriverPrice()) {
                $item->setDriverOriginalPrice($proposal->getCriteria()->getDriverPrice());
            } else {
                // otherwise we use the common price, rounded
                if (!is_null($matching['request']->getOriginalDistance())) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1864..1873

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

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

            if ($proposal->getCriteria()->getPassengerPrice()) {
                $item->setPassengerOriginalPrice($proposal->getCriteria()->getPassengerPrice());
            } else {
                // otherwise we use the common price
                if (!is_null($matching['offer']->getCommonDistance())) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1286..1295

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

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

            if (Ad::ROLE_DRIVER == $role) {
                $waypoints[$key] = [
                    'id' => $key,
                    'person' => 1 == $waypoint['candidate'] ? 'requester' : 'carpooler',
                    'role' => 1 == $waypoint['candidate'] ? 'driver' : 'passenger',
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2714..2727

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

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

            } else {
                $waypoints[$key] = [
                    'id' => $key,
                    'person' => 1 == $waypoint['candidate'] ? 'carpooler' : 'requester',
                    'role' => 1 == $waypoint['candidate'] ? 'driver' : 'passenger',
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2701..2727

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

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 ($proposal->getCriteria()->isTueCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getTueTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2034..2055
api/src/Carpool/Service/ResultManager.php on lines 2057..2078
api/src/Carpool/Service/ResultManager.php on lines 2103..2124
api/src/Carpool/Service/ResultManager.php on lines 2126..2147
api/src/Carpool/Service/ResultManager.php on lines 2149..2170
api/src/Carpool/Service/ResultManager.php on lines 2172..2193

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

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 ($proposal->getCriteria()->isFriCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getFriTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2034..2055
api/src/Carpool/Service/ResultManager.php on lines 2057..2078
api/src/Carpool/Service/ResultManager.php on lines 2080..2101
api/src/Carpool/Service/ResultManager.php on lines 2103..2124
api/src/Carpool/Service/ResultManager.php on lines 2126..2147
api/src/Carpool/Service/ResultManager.php on lines 2172..2193

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

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 ($proposal->getCriteria()->isWedCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getWedTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2034..2055
api/src/Carpool/Service/ResultManager.php on lines 2057..2078
api/src/Carpool/Service/ResultManager.php on lines 2080..2101
api/src/Carpool/Service/ResultManager.php on lines 2126..2147
api/src/Carpool/Service/ResultManager.php on lines 2149..2170
api/src/Carpool/Service/ResultManager.php on lines 2172..2193

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

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 ($proposal->getCriteria()->isSatCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getSatTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2034..2055
api/src/Carpool/Service/ResultManager.php on lines 2057..2078
api/src/Carpool/Service/ResultManager.php on lines 2080..2101
api/src/Carpool/Service/ResultManager.php on lines 2103..2124
api/src/Carpool/Service/ResultManager.php on lines 2126..2147
api/src/Carpool/Service/ResultManager.php on lines 2149..2170

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

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 ($proposal->getCriteria()->isSunCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getSunTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2057..2078
api/src/Carpool/Service/ResultManager.php on lines 2080..2101
api/src/Carpool/Service/ResultManager.php on lines 2103..2124
api/src/Carpool/Service/ResultManager.php on lines 2126..2147
api/src/Carpool/Service/ResultManager.php on lines 2149..2170
api/src/Carpool/Service/ResultManager.php on lines 2172..2193

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

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 ($proposal->getCriteria()->isThuCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getThuTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2034..2055
api/src/Carpool/Service/ResultManager.php on lines 2057..2078
api/src/Carpool/Service/ResultManager.php on lines 2080..2101
api/src/Carpool/Service/ResultManager.php on lines 2103..2124
api/src/Carpool/Service/ResultManager.php on lines 2149..2170
api/src/Carpool/Service/ResultManager.php on lines 2172..2193

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

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 ($proposal->getCriteria()->isMonCheck()
                ) {
                    if (is_null($time)) {
                        return ['numday' => $day, 'time' => $proposal->getCriteria()->getMonTime()];
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 3 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 2034..2055
api/src/Carpool/Service/ResultManager.php on lines 2080..2101
api/src/Carpool/Service/ResultManager.php on lines 2103..2124
api/src/Carpool/Service/ResultManager.php on lines 2126..2147
api/src/Carpool/Service/ResultManager.php on lines 2149..2170
api/src/Carpool/Service/ResultManager.php on lines 2172..2193

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isMonCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getMonTime())) {
                            $monTime = clone $matching['request']->getProposalRequest()->getCriteria()->getMonTime();
                            if ($pickupDuration) {
                                $monTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1126..1135

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isSatCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getSatTime())) {
                            $satTime = clone $matching['request']->getProposalRequest()->getCriteria()->getSatTime();
                            if ($pickupDuration) {
                                $satTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1076..1085

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

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isThuCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getThuTime())) {
                            $thuTime = $matching['request']->getProposalRequest()->getCriteria()->getThuTime();
                            if ($pickupDuration) {
                                $thuTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1086..1095
api/src/Carpool/Service/ResultManager.php on lines 1096..1105
api/src/Carpool/Service/ResultManager.php on lines 1116..1125
api/src/Carpool/Service/ResultManager.php on lines 1136..1145

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

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isFriCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getFriTime())) {
                            $friTime = $matching['request']->getProposalRequest()->getCriteria()->getFriTime();
                            if ($pickupDuration) {
                                $friTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1086..1095
api/src/Carpool/Service/ResultManager.php on lines 1096..1105
api/src/Carpool/Service/ResultManager.php on lines 1106..1115
api/src/Carpool/Service/ResultManager.php on lines 1136..1145

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

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isTueCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getTueTime())) {
                            $tueTime = $matching['request']->getProposalRequest()->getCriteria()->getTueTime();
                            if ($pickupDuration) {
                                $tueTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1096..1105
api/src/Carpool/Service/ResultManager.php on lines 1106..1115
api/src/Carpool/Service/ResultManager.php on lines 1116..1125
api/src/Carpool/Service/ResultManager.php on lines 1136..1145

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

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isSunCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getSunTime())) {
                            $sunTime = $matching['request']->getProposalRequest()->getCriteria()->getSunTime();
                            if ($pickupDuration) {
                                $sunTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1086..1095
api/src/Carpool/Service/ResultManager.php on lines 1096..1105
api/src/Carpool/Service/ResultManager.php on lines 1106..1115
api/src/Carpool/Service/ResultManager.php on lines 1116..1125

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

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isWedCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getWedTime())) {
                            $wedTime = $matching['request']->getProposalRequest()->getCriteria()->getWedTime();
                            if ($pickupDuration) {
                                $wedTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1086..1095
api/src/Carpool/Service/ResultManager.php on lines 1106..1115
api/src/Carpool/Service/ResultManager.php on lines 1116..1125
api/src/Carpool/Service/ResultManager.php on lines 1136..1145

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (isset($matching['request'])) {
                $user1 = $matching['request']->getProposalOffer()->getUser();
                $user2 = $matching['request']->getProposalRequest()->getUser();
                // a user may be null in case of anonymous search
                if ($user1 && $user2) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 790..801

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (isset($matching['offer'])) {
                $user1 = $matching['offer']->getProposalOffer()->getUser();
                $user2 = $matching['offer']->getProposalRequest()->getUser();
                // a user may be null in case of anonymous search
                if ($user1 && $user2) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 778..789

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (!is_null($result->getResultPassenger())) {
                // there's a return as a passenger
                if ($linkedMatching = $this->matchingRepository->findOneBy(['matchingLinked' => $result->getResultPassenger()->getReturn()->getMatchingId()])) {
                    // there's a linked matching, we check if there's an outwardResult with this matching
                    if (isset($results[$linkedMatching->getProposalOffer()->getId()])) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 129..142

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (!is_null($result->getResultDriver())) {
                // there's a return as a driver
                if ($linkedMatching = $this->matchingRepository->findOneBy(['matchingLinked' => $result->getResultDriver()->getReturn()->getMatchingId()])) {
                    // there's a linked matching, we check if there's an outwardResult with this matching
                    if (isset($results[$linkedMatching->getProposalRequest()->getId()])) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 143..156

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isTueCheck()) {
                            $tueTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getTueTime();
                            $driverFromTime = clone $tueTime;
                            if ($pickupDuration) {
                                $tueTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1601..1610
api/src/Carpool/Service/ResultManager.php on lines 1621..1630
api/src/Carpool/Service/ResultManager.php on lines 1631..1640
api/src/Carpool/Service/ResultManager.php on lines 1641..1650
api/src/Carpool/Service/ResultManager.php on lines 1651..1660
api/src/Carpool/Service/ResultManager.php on lines 1661..1670

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isWedCheck()) {
                            $wedTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getWedTime();
                            $driverFromTime = clone $wedTime;
                            if ($pickupDuration) {
                                $wedTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1601..1610
api/src/Carpool/Service/ResultManager.php on lines 1611..1620
api/src/Carpool/Service/ResultManager.php on lines 1631..1640
api/src/Carpool/Service/ResultManager.php on lines 1641..1650
api/src/Carpool/Service/ResultManager.php on lines 1651..1660
api/src/Carpool/Service/ResultManager.php on lines 1661..1670

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isMonCheck()) {
                            $monTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getMonTime();
                            $driverFromTime = clone $monTime;
                            if ($pickupDuration) {
                                $monTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1611..1620
api/src/Carpool/Service/ResultManager.php on lines 1621..1630
api/src/Carpool/Service/ResultManager.php on lines 1631..1640
api/src/Carpool/Service/ResultManager.php on lines 1641..1650
api/src/Carpool/Service/ResultManager.php on lines 1651..1660
api/src/Carpool/Service/ResultManager.php on lines 1661..1670

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isFriCheck()) {
                            $friTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getFriTime();
                            $driverFromTime = clone $friTime;
                            if ($pickupDuration) {
                                $friTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1601..1610
api/src/Carpool/Service/ResultManager.php on lines 1611..1620
api/src/Carpool/Service/ResultManager.php on lines 1621..1630
api/src/Carpool/Service/ResultManager.php on lines 1631..1640
api/src/Carpool/Service/ResultManager.php on lines 1651..1660
api/src/Carpool/Service/ResultManager.php on lines 1661..1670

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isSatCheck()) {
                            $satTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getSatTime();
                            $driverFromTime = clone $satTime;
                            if ($pickupDuration) {
                                $satTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1601..1610
api/src/Carpool/Service/ResultManager.php on lines 1611..1620
api/src/Carpool/Service/ResultManager.php on lines 1621..1630
api/src/Carpool/Service/ResultManager.php on lines 1631..1640
api/src/Carpool/Service/ResultManager.php on lines 1641..1650
api/src/Carpool/Service/ResultManager.php on lines 1661..1670

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isThuCheck()) {
                            $thuTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getThuTime();
                            $driverFromTime = clone $thuTime;
                            if ($pickupDuration) {
                                $thuTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1601..1610
api/src/Carpool/Service/ResultManager.php on lines 1611..1620
api/src/Carpool/Service/ResultManager.php on lines 1621..1630
api/src/Carpool/Service/ResultManager.php on lines 1641..1650
api/src/Carpool/Service/ResultManager.php on lines 1651..1660
api/src/Carpool/Service/ResultManager.php on lines 1661..1670

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

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 ($matching['offer']->getProposalOffer()->getCriteria()->isSunCheck()) {
                            $sunTime = clone $matching['offer']->getProposalOffer()->getCriteria()->getSunTime();
                            $driverFromTime = clone $sunTime;
                            if ($pickupDuration) {
                                $sunTime->add(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 6 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1601..1610
api/src/Carpool/Service/ResultManager.php on lines 1611..1620
api/src/Carpool/Service/ResultManager.php on lines 1621..1630
api/src/Carpool/Service/ResultManager.php on lines 1631..1640
api/src/Carpool/Service/ResultManager.php on lines 1641..1650
api/src/Carpool/Service/ResultManager.php on lines 1651..1660

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                    if (!is_null($b->getDate())) {
                        $dateB = $b->getDate();
                        if (!is_null($b->getTime())) {
                            $timeB = $b->getTime();
                        }
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 194..206

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                    if (!is_null($a->getDate())) {
                        $dateA = $a->getDate();
                        if (!is_null($a->getTime())) {
                            $timeA = $a->getTime();
                        }
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 207..219

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

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

                if (!is_null($matching['offer']->getPickUpDuration())) {
                    $pickupDuration = $matching['offer']->getPickUpDuration();
                } else {
                    $filters = $matching['offer']->getFilters();
                    foreach ($filters['route'] as $value) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 928..939
api/src/Carpool/Service/ResultManager.php on lines 1063..1074
api/src/Carpool/Service/ResultManager.php on lines 1507..1518
api/src/Carpool/Service/ResultManager.php on lines 1588..1599

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

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

                    if (!is_null($matching['offer']->getPickUpDuration())) {
                        $pickupDuration = $matching['offer']->getPickUpDuration();
                    } else {
                        $filters = $matching['offer']->getFilters();
                        foreach ($filters['route'] as $value) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 928..939
api/src/Carpool/Service/ResultManager.php on lines 1063..1074
api/src/Carpool/Service/ResultManager.php on lines 1480..1491
api/src/Carpool/Service/ResultManager.php on lines 1588..1599

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

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

                    if (!is_null($matching['request']->getPickUpDuration())) {
                        $pickupDuration = $matching['request']->getPickUpDuration();
                    } else {
                        $filters = $matching['request']->getFilters();
                        foreach ($filters['route'] as $value) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 1063..1074
api/src/Carpool/Service/ResultManager.php on lines 1480..1491
api/src/Carpool/Service/ResultManager.php on lines 1507..1518
api/src/Carpool/Service/ResultManager.php on lines 1588..1599

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

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

                        if (!is_null($matching['request']->getPickUpDuration())) {
                            $pickupDuration = $matching['request']->getPickUpDuration();
                        } else {
                            $filters = $matching['request']->getFilters();
                            foreach ($filters['route'] as $value) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 928..939
api/src/Carpool/Service/ResultManager.php on lines 1480..1491
api/src/Carpool/Service/ResultManager.php on lines 1507..1518
api/src/Carpool/Service/ResultManager.php on lines 1588..1599

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

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

                        if (!is_null($matching['offer']->getPickUpDuration())) {
                            $pickupDuration = $matching['offer']->getPickUpDuration();
                        } else {
                            $filters = $matching['offer']->getFilters();
                            foreach ($filters['route'] as $value) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 1 hr to fix
api/src/Carpool/Service/ResultManager.php on lines 928..939
api/src/Carpool/Service/ResultManager.php on lines 1063..1074
api/src/Carpool/Service/ResultManager.php on lines 1480..1491
api/src/Carpool/Service/ResultManager.php on lines 1507..1518

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if (Ad::ROLE_DRIVER == $role) {
                if (1 == $waypoint['candidate'] && (int) $waypoint['position'] > $steps['requester']) {
                    $steps['requester'] = (int) $waypoint['position'];
                } elseif (2 == $waypoint['candidate'] && (int) $waypoint['position'] > $steps['carpooler']) {
                    $steps['carpooler'] = (int) $waypoint['position'];
Severity: Minor
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 2684..2690

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

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

            } else {
                if (1 == $waypoint['candidate'] && (int) $waypoint['position'] > $steps['carpooler']) {
                    $steps['carpooler'] = (int) $waypoint['position'];
                } elseif (2 == $waypoint['candidate'] && (int) $waypoint['position'] > $steps['requester']) {
                    $steps['requester'] = (int) $waypoint['position'];
Severity: Minor
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 2678..2690

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

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['request']->getFilters()['pickup']['monMinPickupTime'], $matching['request']->getFilters()['pickup']['monMaxPickupTime'])) {
                            $item->setMonCheck(true);
                            $item->setMonTime($proposal->getCriteria()->getMonTime());
                            $item->setTime($proposal->getCriteria()->getMonTime());
                            $item->setMonMarginDuration($proposal->getCriteria()->getMonMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['request']->getFilters()['pickup']['friMinPickupTime'], $matching['request']->getFilters()['pickup']['friMaxPickupTime'])) {
                            $item->setFriCheck(true);
                            $item->setFriTime($proposal->getCriteria()->getFriTime());
                            $item->setTime($proposal->getCriteria()->getFriTime());
                            $item->setFriMarginDuration($proposal->getCriteria()->getFriMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['request']->getFilters()['pickup']['satMinPickupTime'], $matching['request']->getFilters()['pickup']['satMaxPickupTime'])) {
                            $item->setSatCheck(true);
                            $item->setSatTime($proposal->getCriteria()->getSatTime());
                            $item->setTime($proposal->getCriteria()->getSatTime());
                            $item->setSatMarginDuration($proposal->getCriteria()->getSatMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['thuMinPickupTime'], $matching['offer']->getFilters()['pickup']['thuMaxPickupTime'])) {
                            $item->setThuCheck(true);
                            $item->setThuTime($proposal->getCriteria()->getThuTime());
                            $item->setTime($proposal->getCriteria()->getThuTime());
                            $item->setThuMarginDuration($proposal->getCriteria()->getThuMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['monMinPickupTime'], $matching['offer']->getFilters()['pickup']['monMaxPickupTime'])) {
                            $item->setMonCheck(true);
                            $item->setMonTime($proposal->getCriteria()->getMonTime());
                            $item->setTime($proposal->getCriteria()->getMonTime());
                            $item->setMonMarginDuration($proposal->getCriteria()->getMonMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['request']->getFilters()['pickup']['wedMinPickupTime'], $matching['request']->getFilters()['pickup']['wedMaxPickupTime'])) {
                            $item->setWedCheck(true);
                            $item->setWedTime($proposal->getCriteria()->getWedTime());
                            $item->setTime($proposal->getCriteria()->getWedTime());
                            $item->setWedMarginDuration($proposal->getCriteria()->getWedMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['friMinPickupTime'], $matching['offer']->getFilters()['pickup']['friMaxPickupTime'])) {
                            $item->setFriCheck(true);
                            $item->setFriTime($proposal->getCriteria()->getFriTime());
                            $item->setTime($proposal->getCriteria()->getFriTime());
                            $item->setFriMarginDuration($proposal->getCriteria()->getFriMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['request']->getFilters()['pickup']['thuMinPickupTime'], $matching['request']->getFilters()['pickup']['thuMaxPickupTime'])) {
                            $item->setThuCheck(true);
                            $item->setThuTime($proposal->getCriteria()->getThuTime());
                            $item->setTime($proposal->getCriteria()->getThuTime());
                            $item->setThuMarginDuration($proposal->getCriteria()->getThuMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['tueMinPickupTime'], $matching['offer']->getFilters()['pickup']['tueMaxPickupTime'])) {
                            $item->setTueCheck(true);
                            $item->setTueTime($proposal->getCriteria()->getTueTime());
                            $item->setTime($proposal->getCriteria()->getTueTime());
                            $item->setTueMarginDuration($proposal->getCriteria()->getTueMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['wedMinPickupTime'], $matching['offer']->getFilters()['pickup']['wedMaxPickupTime'])) {
                            $item->setWedCheck(true);
                            $item->setWedTime($proposal->getCriteria()->getWedTime());
                            $item->setTime($proposal->getCriteria()->getWedTime());
                            $item->setWedMarginDuration($proposal->getCriteria()->getWedMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['request']->getFilters()['pickup']['tueMinPickupTime'], $matching['request']->getFilters()['pickup']['tueMaxPickupTime'])) {
                            $item->setTueCheck(true);
                            $item->setTueTime($proposal->getCriteria()->getTueTime());
                            $item->setTime($proposal->getCriteria()->getTueTime());
                            $item->setTueMarginDuration($proposal->getCriteria()->getTueMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['sunMinPickupTime'], $matching['offer']->getFilters()['pickup']['sunMaxPickupTime'])) {
                            $item->setSunCheck(true);
                            $item->setSunTime($proposal->getCriteria()->getSunTime());
                            $item->setTime($proposal->getCriteria()->getSunTime());
                            $item->setSunMarginDuration($proposal->getCriteria()->getSunMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['offer']->getFilters()['pickup']['satMinPickupTime'], $matching['offer']->getFilters()['pickup']['satMaxPickupTime'])) {
                            $item->setSatCheck(true);
                            $item->setSatTime($proposal->getCriteria()->getSatTime());
                            $item->setTime($proposal->getCriteria()->getSatTime());
                            $item->setSatMarginDuration($proposal->getCriteria()->getSatMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1044..1049
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        if (isset($matching['request']->getFilters()['pickup']['sunMinPickupTime'], $matching['request']->getFilters()['pickup']['sunMaxPickupTime'])) {
                            $item->setSunCheck(true);
                            $item->setSunTime($proposal->getCriteria()->getSunTime());
                            $item->setTime($proposal->getCriteria()->getSunTime());
                            $item->setSunMarginDuration($proposal->getCriteria()->getSunMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 13 other locations - About 45 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1008..1013
api/src/Carpool/Service/ResultManager.php on lines 1014..1019
api/src/Carpool/Service/ResultManager.php on lines 1020..1025
api/src/Carpool/Service/ResultManager.php on lines 1026..1031
api/src/Carpool/Service/ResultManager.php on lines 1032..1037
api/src/Carpool/Service/ResultManager.php on lines 1038..1043
api/src/Carpool/Service/ResultManager.php on lines 1532..1537
api/src/Carpool/Service/ResultManager.php on lines 1538..1543
api/src/Carpool/Service/ResultManager.php on lines 1544..1549
api/src/Carpool/Service/ResultManager.php on lines 1550..1555
api/src/Carpool/Service/ResultManager.php on lines 1556..1561
api/src/Carpool/Service/ResultManager.php on lines 1562..1567
api/src/Carpool/Service/ResultManager.php on lines 1568..1573

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                if (Criteria::FREQUENCY_PUNCTUAL == $matching['request']->getProposalRequest()->getCriteria()->getFrequency()) {
                    $item->setDate($matching['request']->getProposalRequest()->getCriteria()->getFromDate());
                } else {
                    $regularDayInfos = $this->getMatchingRegularDayAsOffer($matching['request'], $item);
                    $item = $regularDayInfos['item'];
Severity: Minor
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 35 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 1455..1461

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                if (Criteria::FREQUENCY_PUNCTUAL == $matching['offer']->getProposalOffer()->getCriteria()->getFrequency()) {
                    $item->setDate($matching['offer']->getProposalOffer()->getCriteria()->getFromDate());
                } else {
                    $regularDayInfos = $this->getMatchingRegularDayAsRequest($matching['offer'], $item);
                    $item = $regularDayInfos['item'];
Severity: Minor
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 35 mins to fix
api/src/Carpool/Service/ResultManager.php on lines 903..909

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

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