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 1316..1475

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

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 1118..1278

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 565..725

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($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 1480..1538

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($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 930..988

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

        $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 546..560

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

        $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 1099..1113

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->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 252..267

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->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 319..334

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 1653..1661

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 1644..1652

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 ($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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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->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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 432..438
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 411..417
api/src/Carpool/Service/MyAdManager.php on lines 418..424
api/src/Carpool/Service/MyAdManager.php on lines 425..431
api/src/Carpool/Service/MyAdManager.php on lines 439..445
api/src/Carpool/Service/MyAdManager.php on lines 458..464
api/src/Carpool/Service/MyAdManager.php on lines 465..471
api/src/Carpool/Service/MyAdManager.php on lines 472..478
api/src/Carpool/Service/MyAdManager.php on lines 479..485
api/src/Carpool/Service/MyAdManager.php on lines 486..492

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 739..749

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 1291..1301

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 451..457

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 404..410

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