Covivo/mobicoop

View on GitHub
api/src/Communication/EventSubscriber/CarpoolSubscriber.php

Summary

Maintainability
F
3 wks
Test Coverage

CarpoolSubscriber has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class CarpoolSubscriber implements EventSubscriberInterface
{
    use TranslatorTrait;

    private $notificationManager;
Severity: Minor
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php - About 2 hrs to fix

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

                if ((($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? $outwardResult->getFriTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getFriTime() && $askLinkedConcerned->getCriteria()->isFriCheck()) ? $returnResult->getFriTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? clone $outwardResult->getFriTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? clone $outwardResult->getFriTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

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

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

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

    Refactorings

    Further Reading

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

                if ((($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? $outwardResult->getSunTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSunTime() && $askLinkedConcerned->getCriteria()->isSunCheck()) ? $returnResult->getSunTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? clone $outwardResult->getSunTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? clone $outwardResult->getSunTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605

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

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

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

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

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

    Refactorings

    Further Reading

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

                if ((($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? $outwardResult->getThuTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getThuTime() && $askLinkedConcerned->getCriteria()->isThuCheck()) ? $returnResult->getThuTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? clone $outwardResult->getThuTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? clone $outwardResult->getThuTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

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

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

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

    Refactorings

    Further Reading

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

                if ((($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? $outwardResult->getSatTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSatTime() && $askLinkedConcerned->getCriteria()->isSatCheck()) ? $returnResult->getSatTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? clone $outwardResult->getSatTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? clone $outwardResult->getSatTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

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

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

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

    Refactorings

    Further Reading

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

                if ((($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? $outwardResult->getTueTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getTueTime() && $askLinkedConcerned->getCriteria()->isTueCheck()) ? $returnResult->getTueTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? clone $outwardResult->getTueTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? clone $outwardResult->getTueTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

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

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

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

    Refactorings

    Further Reading

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

                if ((($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? $outwardResult->getWedTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getWedTime() && $askLinkedConcerned->getCriteria()->isWedCheck()) ? $returnResult->getWedTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? clone $outwardResult->getWedTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? clone $outwardResult->getWedTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

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

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

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

    Refactorings

    Further Reading

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

                if ((($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? $outwardResult->getMonTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getMonTime() && $askLinkedConcerned->getCriteria()->isMonCheck()) ? $returnResult->getMonTime()->format('H:i') : 'null') == $time) {
                    // outward
                    $outwardDriverDepartureTime = ($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? clone $outwardResult->getMonTime() : null;
                    $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                    $outwardDriverDepartureTime = ($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? clone $outwardResult->getMonTime() : null;
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

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

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

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

    Refactorings

    Further Reading

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

        public function onDriverAskAdDeletedUrgent(DriverAskAdDeletedUrgentEvent $event)
        {
            // todo : idem
            if ($this->canNotify($event->getAsk()->getUser(), $event->getAsk()->getUserRelated())) {
                if ($event->getAsk()->getUser()->getId() == $event->getDeleterId()) {
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 4 other locations - About 7 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 257..274
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 279..297
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 302..318
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 323..339

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

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

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

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

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

    Refactorings

    Further Reading

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

        public function onPassengerAskAdDeletedUrgent(PassengerAskAdDeletedUrgentEvent $event)
        {
            // todo : idem
            if ($this->canNotify($event->getAsk()->getUser(), $event->getAsk()->getUserRelated())) {
                if ($event->getAsk()->getUser()->getId() == $event->getDeleterId()) {
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 4 other locations - About 7 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 257..274
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 279..297
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 323..339
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 344..360

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

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

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

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

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

    Refactorings

    Further Reading

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

        public function onAskAdDeleted(AskAdDeletedEvent $event)
        {
            // todo: passer directement la ask pour pouvoir mieux vérifier qui est à l'origine de l'annonce
            // pas réussi, array vide depuis le template en passant la ask
            if ($this->canNotify($event->getAsk()->getUser(), $event->getAsk()->getUserRelated())) {
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 4 other locations - About 7 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 279..297
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 302..318
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 323..339
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 344..360

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

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

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

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

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

    Refactorings

    Further Reading

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

        public function onPassengerAskAdDeleted(PassengerAskAdDeletedEvent $event)
        {
            // todo : idem
    
            if ($this->canNotify($event->getAsk()->getUser(), $event->getAsk()->getUserRelated())) {
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 4 other locations - About 7 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 257..274
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 302..318
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 323..339
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 344..360

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

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

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

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

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

    Refactorings

    Further Reading

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

        public function onDriverAskAdDeleted(DriverAskAdDeletedEvent $event)
        {
            // todo : idem
            if ($this->canNotify($event->getAsk()->getUser(), $event->getAsk()->getUserRelated())) {
                if ($event->getAsk()->getUser()->getId() == $event->getDeleterId()) {
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 4 other locations - About 7 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 257..274
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 279..297
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 302..318
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 344..360

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? $outwardResult->getSunTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSunTime() && $askLinkedConcerned->getCriteria()->isSunCheck()) ? $returnResult->getSunTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? $outwardResult->getSunTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSunTime() && $askLinkedConcerned->getCriteria()->isSunCheck()) ? $returnResult->getSunTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 483..485
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 487..489
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 491..493
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 495..497
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 499..501
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 503..505

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? $outwardResult->getMonTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getMonTime() && $askLinkedConcerned->getCriteria()->isMonCheck()) ? $returnResult->getMonTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? $outwardResult->getMonTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getMonTime() && $askLinkedConcerned->getCriteria()->isMonCheck()) ? $returnResult->getMonTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 487..489
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 491..493
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 495..497
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 499..501
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 503..505
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 507..509

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? $outwardResult->getWedTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getWedTime() && $askLinkedConcerned->getCriteria()->isWedCheck()) ? $returnResult->getWedTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? $outwardResult->getWedTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getWedTime() && $askLinkedConcerned->getCriteria()->isWedCheck()) ? $returnResult->getWedTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 483..485
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 487..489
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 495..497
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 499..501
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 503..505
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 507..509

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? $outwardResult->getThuTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getThuTime() && $askLinkedConcerned->getCriteria()->isThuCheck()) ? $returnResult->getThuTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? $outwardResult->getThuTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getThuTime() && $askLinkedConcerned->getCriteria()->isThuCheck()) ? $returnResult->getThuTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 483..485
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 487..489
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 491..493
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 499..501
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 503..505
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 507..509

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? $outwardResult->getFriTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getFriTime() && $askLinkedConcerned->getCriteria()->isFriCheck()) ? $returnResult->getFriTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? $outwardResult->getFriTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getFriTime() && $askLinkedConcerned->getCriteria()->isFriCheck()) ? $returnResult->getFriTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 483..485
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 487..489
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 491..493
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 495..497
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 503..505
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 507..509

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? $outwardResult->getSatTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSatTime() && $askLinkedConcerned->getCriteria()->isSatCheck()) ? $returnResult->getSatTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? $outwardResult->getSatTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSatTime() && $askLinkedConcerned->getCriteria()->isSatCheck()) ? $returnResult->getSatTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 483..485
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 487..489
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 491..493
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 495..497
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 499..501
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 507..509

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (!in_array((($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? $outwardResult->getTueTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getTueTime() && $askLinkedConcerned->getCriteria()->isTueCheck()) ? $returnResult->getTueTime()->format('H:i') : 'null'), $times)) {
                $times[] = (($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? $outwardResult->getTueTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getTueTime() && $askLinkedConcerned->getCriteria()->isTueCheck()) ? $returnResult->getTueTime()->format('H:i') : 'null');
            }
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 4 hrs to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 483..485
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 491..493
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 495..497
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 499..501
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 503..505
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 507..509

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

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

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

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

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

    Refactorings

    Further Reading

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

        public function __construct(
            NotificationManager $notificationManager,
            AskHistoryRepository $askHistoryRepository,
            LoggerInterface $logger,
            UrlGeneratorInterface $router,
    Severity: Major
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 4 other locations - About 2 hrs to fix
    api/src/Auth/Service/PermissionManager.php on lines 64..82
    api/src/Community/Admin/Service/CommunityManager.php on lines 64..82
    api/src/Geography/Service/AddressManager.php on lines 55..65
    api/src/Solidary/Admin/Service/StructureManager.php on lines 61..79

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

    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

                $schedule = [
                    'outwardPickUpTime' => null,
                    'outwardDropOffTime' => null,
                    'returnPickUpTime' => null,
                    'returnDropOffTime' => null,
    Severity: Minor
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 1 other location - About 45 mins to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 511..523

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 96.

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

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

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

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

    Refactorings

    Further Reading

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

            $schedule = [
                'outwardPickUpTime' => null,
                'outwardDropOffTime' => null,
                'returnPickUpTime' => null,
                'returnDropOffTime' => null,
    Severity: Minor
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 1 other location - About 45 mins to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 620..632

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 96.

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

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

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

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

    Refactorings

    Further Reading

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

                if ($this->canNotify($ask->getUser(), $ask->getUserRelated())) {
                    $ad = $this->askManager->getAskFromAd($ask->getId(), $ask->getUser()->getId());
                    $ad->setSchedule($this->addSchedule($ad));
                    $ask->setAd($ad);
                    $this->notificationManager->notifies(AdMajorUpdatedEvent::NAME, $ask->getUser(), $object);
    Severity: Minor
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 1 other location - About 40 mins to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 372..377

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 94.

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

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

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

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

    Refactorings

    Further Reading

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

                if ($this->canNotify($ask->getUser(), $ask->getUserRelated())) {
                    $ad = $this->askManager->getAskFromAd($ask->getId(), $ask->getUser()->getId());
                    $ad->setSchedule($this->addSchedule($ad));
                    $ask->setAd($ad);
                    $this->notificationManager->notifies(AdMinorUpdatedEvent::NAME, $ask->getUser(), $object);
    Severity: Minor
    Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 1 other location - About 40 mins to fix
    api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 426..431

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 94.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status