Covivo/mobicoop

View on GitHub

Showing 1,607 of 1,615 total issues

Similar blocks of code found in 2 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/Version20210622084802.php and 1 other location - About 7 hrs to fix
api/src/Migrations/Version20190507131703.php on lines 57..84

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

    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/Version20190507131703.php and 1 other location - About 7 hrs to fix
api/src/Migrations/Version20210622084802.php on lines 13..40

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/CarpoolAskPostedRelaunch1Command.php and 1 other location - About 7 hrs to fix
api/src/Command/Command/CarpoolAskPostedRelaunch2Command.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 4 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20230530081044.php and 3 other locations - About 7 hrs to fix
api/src/Migrations/Version20190125131955.php on lines 1..63
api/src/Migrations/Version20210601082339.php on lines 1..42
api/src/Migrations/Version20230111152606.php on lines 1..42

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20210601082339.php and 3 other locations - About 7 hrs to fix
api/src/Migrations/Version20190125131955.php on lines 1..63
api/src/Migrations/Version20230111152606.php on lines 1..42
api/src/Migrations/Version20230530081044.php on lines 1..42

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20230111152606.php and 3 other locations - About 7 hrs to fix
api/src/Migrations/Version20190125131955.php on lines 1..63
api/src/Migrations/Version20210601082339.php on lines 1..42
api/src/Migrations/Version20230530081044.php on lines 1..42

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

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

<?php declare(strict_types=1);

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Migrations/Version20190125131955.php and 3 other locations - About 7 hrs to fix
api/src/Migrations/Version20210601082339.php on lines 1..42
api/src/Migrations/Version20230111152606.php on lines 1..42
api/src/Migrations/Version20230530081044.php on lines 1..42

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

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

                    [
                        'user_id' => $user['id'],
                        'validated_date' => $user['validated_date'],
                        'phone_validated_date' => $user['phone_validated_date'],
                        'telephone' => $user['telephone'],
Severity: Major
Found in api/src/Gamification/Service/RetroactivelyRewardService.php and 1 other location - About 7 hrs to fix
api/src/Gamification/Service/RetroactivelyRewardService.php on lines 262..289

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

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

                    [
                        'user_id' => $user['id'],
                        'validated_date' => $user['validated_date'],
                        'phone_validated_date' => $user['phone_validated_date'],
                        'telephone' => $user['telephone'],
Severity: Major
Found in api/src/Gamification/Service/RetroactivelyRewardService.php and 1 other location - About 7 hrs to fix
api/src/Gamification/Service/RetroactivelyRewardService.php on lines 231..258

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

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

RelayPoint has 51 functions (exceeds 20 allowed). Consider refactoring.
Open

class RelayPoint implements ResourceInterface, \JsonSerializable
{
    const STATUS_PENDING = 0;
    const STATUS_ACTIVE = 1;
    const STATUS_INACTIVE = 2;
Severity: Major
Found in client/src/MobicoopBundle/RelayPoint/Entity/RelayPoint.php - About 7 hrs to fix

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

                            if ($proposal1->getCriteria()->isTueCheck() && $proposal2->getCriteria()->isTueCheck()) {
                                $tuePickupTime = clone $proposal1->getCriteria()->getTueTime();
                                $tueMinPickupTime = clone $proposal1->getCriteria()->getTueMinTime();
                                $tueMaxPickupTime = clone $proposal1->getCriteria()->getTueMaxTime();
                                $tuePickupTime->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 1841..1857
    api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
    api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
    api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
    api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
    api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

    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() && $proposal2->getCriteria()->isThuCheck()) {
                                $thuPickupTime = clone $proposal1->getCriteria()->getThuTime();
                                $thuMinPickupTime = clone $proposal1->getCriteria()->getThuMinTime();
                                $thuMaxPickupTime = clone $proposal1->getCriteria()->getThuMaxTime();
                                $thuPickupTime->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 1841..1857
    api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
    api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
    api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
    api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
    api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

    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()->isWedCheck() && $proposal2->getCriteria()->isWedCheck()) {
                                $wedPickupTime = clone $proposal1->getCriteria()->getWedTime();
                                $wedMinPickupTime = clone $proposal1->getCriteria()->getWedMinTime();
                                $wedMaxPickupTime = clone $proposal1->getCriteria()->getWedMaxTime();
                                $wedPickupTime->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 1841..1857
    api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
    api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
    api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
    api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
    api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

    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() && $proposal2->getCriteria()->isSunCheck()) {
                                $sunPickupTime = clone $proposal1->getCriteria()->getSunTime();
                                $sunMinPickupTime = clone $proposal1->getCriteria()->getSunMinTime();
                                $sunMaxPickupTime = clone $proposal1->getCriteria()->getSunMaxTime();
                                $sunPickupTime->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 1841..1857
    api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
    api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
    api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
    api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
    api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942

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

    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() && $proposal2->getCriteria()->isSatCheck()) {
                                $satPickupTime = clone $proposal1->getCriteria()->getSatTime();
                                $satMinPickupTime = clone $proposal1->getCriteria()->getSatMinTime();
                                $satMaxPickupTime = clone $proposal1->getCriteria()->getSatMaxTime();
                                $satPickupTime->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 1841..1857
    api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
    api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
    api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
    api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
    api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

    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() && $proposal2->getCriteria()->isFriCheck()) {
                                $friPickupTime = clone $proposal1->getCriteria()->getFriTime();
                                $friMinPickupTime = clone $proposal1->getCriteria()->getFriMinTime();
                                $friMaxPickupTime = clone $proposal1->getCriteria()->getFriMaxTime();
                                $friPickupTime->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 1841..1857
    api/src/Carpool/Service/ProposalMatcher.php on lines 1858..1874
    api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
    api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
    api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
    api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

    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() && $proposal2->getCriteria()->isMonCheck()) {
                                $monPickupTime = clone $proposal1->getCriteria()->getMonTime();
                                $monMinPickupTime = clone $proposal1->getCriteria()->getMonMinTime();
                                $monMaxPickupTime = clone $proposal1->getCriteria()->getMonMaxTime();
                                $monPickupTime->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 1858..1874
    api/src/Carpool/Service/ProposalMatcher.php on lines 1875..1891
    api/src/Carpool/Service/ProposalMatcher.php on lines 1892..1908
    api/src/Carpool/Service/ProposalMatcher.php on lines 1909..1925
    api/src/Carpool/Service/ProposalMatcher.php on lines 1926..1942
    api/src/Carpool/Service/ProposalMatcher.php on lines 1943..1959

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

    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

        public function getDestinations(string $city)
        {
            $response = $this->dataProvider->getSpecialCollection('destinations/'.$city);
            if ($response->getCode() >=200 && $response->getCode() <= 300) {
                $origin = $city;
    Severity: Major
    Found in client/src/MobicoopBundle/Journey/Service/JourneyManager.php and 1 other location - About 7 hrs to fix
    client/src/MobicoopBundle/Journey/Service/JourneyManager.php on lines 119..146

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

    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

        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/Version20200222085639.php and 1 other location - About 7 hrs to fix
    api/src/Migrations/Version20210804131213.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 224.

    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

        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/Version20210804131213.php and 1 other location - About 7 hrs to fix
    api/src/Migrations/Version20200222085639.php on lines 44..70

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

    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