Covivo/mobicoop

View on GitHub

Showing 1,607 of 1,615 total issues

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

    public function up(Schema $schema) : void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

Severity: Major
Found in api/src/Migrations/Version20210819133003.php and 2 other locations - About 7 hrs to fix
api/src/Migrations/Version20190809160100.php on lines 40..68
api/src/Migrations/Version20191121100525.php on lines 20..48

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

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

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

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

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

Refactorings

Further Reading

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

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
        
Severity: Major
Found in api/src/Migrations/Version20190809160100.php and 2 other locations - About 7 hrs to fix
api/src/Migrations/Version20191121100525.php on lines 20..48
api/src/Migrations/Version20210819133003.php on lines 13..41

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

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

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

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

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

Refactorings

Further Reading

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

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

Severity: Major
Found in api/src/Migrations/Version20191121100525.php and 2 other locations - About 7 hrs to fix
api/src/Migrations/Version20190809160100.php on lines 40..68
api/src/Migrations/Version20210819133003.php on lines 13..41

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

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

ArticleController has 54 functions (exceeds 20 allowed). Consider refactoring.
Open

class ArticleController extends AbstractController
{
    use HydraControllerTrait;

    public const CGU = 1;
Severity: Major
Found in client/src/MobicoopBundle/Article/Controller/ArticleController.php - About 7 hrs to fix

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 237.

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

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

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

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

    Refactorings

    Further Reading

    Proposal has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Proposal extends GamificationEntity implements ResourceInterface, \JsonSerializable
    {
        const TYPE_ONE_WAY = 1;
        const TYPE_OUTWARD = 2;
        const TYPE_RETURN = 3;
    Severity: Major
    Found in client/src/MobicoopBundle/Carpool/Entity/Proposal.php - About 7 hrs to fix

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

      <?php
      
      /**
       * Copyright (c) 2018, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      Severity: Major
      Found in api/src/PublicTransport/Entity/PTArrival.php and 1 other location - About 7 hrs to fix
      api/src/PublicTransport/Entity/PTDeparture.php on lines 1..165

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

      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

      <?php
      
      /**
       * Copyright (c) 2022, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      Severity: Major
      Found in api/src/Command/Command/CarpoolAskPostedRelaunch2Command.php and 1 other location - About 7 hrs to fix
      api/src/Command/Command/CarpoolAskPostedRelaunch1Command.php on lines 1..74

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

      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

      <?php
      
      /**
       * Copyright (c) 2018, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      Severity: Major
      Found in api/src/PublicTransport/Entity/PTDeparture.php and 1 other location - About 7 hrs to fix
      api/src/PublicTransport/Entity/PTArrival.php on lines 1..164

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

      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

      Severity
      Category
      Status
      Source
      Language