Covivo/mobicoop

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

Summary

Maintainability
F
3 mos
Test Coverage

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

            switch ($ask->getAskLinked()->getCriteria()->getFrequency()) {
                case Criteria::FREQUENCY_PUNCTUAL:
                    /**
                     * @var \DateTime $startDate
                     */
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 2 wks to fix
api/src/Carpool/Service/MyAdManager.php on lines 762..921

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

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

            switch ($ask->getAskLinked()->getCriteria()->getFrequency()) {
                case Criteria::FREQUENCY_PUNCTUAL:
                    /**
                     * @var \DateTime $startDate
                     */
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 2 wks to fix
api/src/Carpool/Service/MyAdManager.php on lines 1312..1471

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

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

        switch ($ask->getCriteria()->getFrequency()) {
            case Criteria::FREQUENCY_PUNCTUAL:
                /**
                 * @var \DateTime $startDate
                 */
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 2 wks to fix
api/src/Carpool/Service/MyAdManager.php on lines 561..721

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

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

        switch ($ask->getCriteria()->getFrequency()) {
            case Criteria::FREQUENCY_PUNCTUAL:
                /**
                 * @var \DateTime $startDate
                 */
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 2 wks to fix
api/src/Carpool/Service/MyAdManager.php on lines 1114..1274

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

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($passenger['schedule'])) {
            $schedules = [];
            foreach (['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] as $day) {
                $key = $this->getSchedulesKey(
                    $schedules,
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 4 days to fix
api/src/Carpool/Service/MyAdManager.php on lines 926..984

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

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($driver['schedule'])) {
            $schedules = [];
            foreach (['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] as $day) {
                $key = $this->getSchedulesKey(
                    $schedules,
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 4 days to fix
api/src/Carpool/Service/MyAdManager.php on lines 1476..1534

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

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

        $driver = [
            'id' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getId() : $ask->getUser()->getId(),
            'givenName' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getGivenName() : $ask->getUser()->getGivenName(),
            'shortFamilyName' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getShortFamilyName() : $ask->getUser()->getShortFamilyName(),
            'birthYear' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getBirthYear() : $ask->getUser()->getBirthYear(),
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/MyAdManager.php on lines 1095..1109

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

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

        $passenger = [
            'id' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getId() : $ask->getUser()->getId(),
            'givenName' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getGivenName() : $ask->getUser()->getGivenName(),
            'shortFamilyName' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getShortFamilyName() : $ask->getUser()->getShortFamilyName(),
            'birthYear' => $ask->getUser()->getId() == $user->getId() ? $ask->getUserRelated()->getBirthYear() : $ask->getUser()->getBirthYear(),
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 day to fix
api/src/Carpool/Service/MyAdManager.php on lines 542..556

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

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 === $ask->getCriteria()->getFrequency()) {
                        foreach ($ask->getCarpoolProofs() as $carpoolProof) {
                            if ($carpoolProof->getDriver()->getId() === $driver['id']) {
                                $driver['classicProof'] = $this->proofManager->getClassicProof($carpoolProof->getId());
                            }
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/MyAdManager.php on lines 318..333

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

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 === $ask->getCriteria()->getFrequency()) {
                        foreach ($ask->getCarpoolProofs() as $carpoolProof) {
                            if ($carpoolProof->getPassenger()->getId() === $passenger['id']) {
                                $passenger['classicProof'] = $this->proofManager->getClassicProof($carpoolProof->getId());
                            }
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/MyAdManager.php on lines 251..266

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

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 (MyAd::ROLE_PASSENGER == $role && CarpoolItem::STATUS_NOT_REALIZED !== $carpoolItem->getItemStatus() && CarpoolItem::DEBTOR_STATUS_PENDING == $carpoolItem->getDebtorStatus()) {
                // passenger has to pay
                return [
                    'status' => MyAd::PAYMENT_STATUS_TODO,
                    'unpaidDate' => !is_null($carpoolItem->getUnpaidDate()) ? $carpoolItem->getUnpaidDate()->format('Y-m-d') : null,
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 1649..1657

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

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 (MyAd::ROLE_DRIVER == $role && CarpoolItem::STATUS_NOT_REALIZED !== $carpoolItem->getItemStatus() && CarpoolItem::CREDITOR_STATUS_PENDING == $carpoolItem->getCreditorStatus()) {
                // driver has to validate
                return [
                    'status' => MyAd::PAYMENT_STATUS_TODO,
                    'unpaidDate' => !is_null($carpoolItem->getUnpaidDate()) ? $carpoolItem->getUnpaidDate()->format('Y-m-d') : null,
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 1640..1648

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

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

        if ($criteria->isThuCheck() && !is_null($criteria->getThuTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getThuTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getThuTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isSunCheck() && !is_null($returnCriteria->getSunTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getSunTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getsunTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481

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

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

        if ($criteria->isSatCheck() && !is_null($criteria->getSatTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getSatTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getSatTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isThuCheck() && !is_null($returnCriteria->getThuTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getThuTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getThuTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isSatCheck() && !is_null($returnCriteria->getSatTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getSatTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getSatTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isSunCheck() && !is_null($criteria->getSunTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getSunTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getSunTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isFriCheck() && !is_null($returnCriteria->getFriTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getFriTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getFriTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isWedCheck() && !is_null($criteria->getWedTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getWedTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getWedTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isFriCheck() && !is_null($criteria->getFriTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getFriTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getFriTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isWedCheck() && !is_null($returnCriteria->getWedTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getWedTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getWedTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

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

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

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

Refactorings

Further Reading

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

                    $waypoints[] = [
                        'position' => $waypoint->getPosition(),
                        'destination' => $waypoint->isDestination(),
                        'houseNumber' => $waypoint->getAddress()->getHouseNumber(),
                        'street' => $waypoint->getAddress()->getStreet(),
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 1287..1297

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

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

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

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

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

Refactorings

Further Reading

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

                    $waypoints[] = [
                        'position' => $waypoint->getPosition(),
                        'destination' => $waypoint->isDestination(),
                        'houseNumber' => $waypoint->getAddress()->getHouseNumber(),
                        'street' => $waypoint->getAddress()->getStreet(),
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 735..745

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

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->isTueCheck() && !is_null($criteria->getTueTime())) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getTueTime()->format('H:i');
            } elseif ($schedule['outwardTime'] !== $criteria->getTueTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Minor
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 35 mins to fix
api/src/Carpool/Service/MyAdManager.php on lines 447..453

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 ($returnCriteria->isTueCheck() && !is_null($returnCriteria->getTueTime())) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getTueTime()->format('H:i');
                } elseif ($schedule['returnTime'] !== $returnCriteria->getTueTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Minor
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 35 mins to fix
api/src/Carpool/Service/MyAdManager.php on lines 400..406

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