Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isMonCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getMonTime())) {
                            $monTime = clone $matching['request']->getProposalRequest()->getCriteria()->getMonTime();
                            if ($pickupDuration) {
                                $monTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1128..1137

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

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

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

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

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

Refactorings

Further Reading

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

                        if ($matching['request']->getProposalRequest()->getCriteria()->isSatCheck()
                            && !is_null($matching['request']->getProposalRequest()->getCriteria()->getSatTime())) {
                            $satTime = clone $matching['request']->getProposalRequest()->getCriteria()->getSatTime();
                            if ($pickupDuration) {
                                $satTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 2 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1078..1087

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

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

MangoPayProvider has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class MangoPayProvider implements PaymentProviderInterface
{
    public const SERVER_URL_SANDBOX = 'https://api.sandbox.mangopay.com/';
    public const SERVER_URL = 'https://api.mangopay.com/';
    public const LANDING_AFTER_PAYMENT = 'paiements/paye';
Severity: Minor
Found in api/src/DataProvider/Entity/MangoPayProvider.php - About 2 hrs to fix

    UserImport has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class UserImport
    {
        public const DEFAULT_ID = 999999999999;
    
        public const STATUS_IMPORTED = 0;          // the external user has been imported, no treatment has been made yet
    Severity: Minor
    Found in api/src/Import/Entity/UserImport.php - About 2 hrs to fix

      Editorial has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Editorial
      {
          const STATUS_ACTIVE = 1;
          const STATUS_INACTIVE = 0;
          /**
      Severity: Minor
      Found in api/src/Editorial/Entity/Editorial.php - About 2 hrs to fix

        GratuityCampaign has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class GratuityCampaign
        {
            public const DEFAULT_ID = 999999999999;
        
            /**
        Severity: Minor
        Found in api/src/Gratuity/Resource/GratuityCampaign.php - About 2 hrs to fix

          Car has 24 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Car
          {
              /**
               * @var int $id The id of this car.
               *
          Severity: Minor
          Found in api/src/User/Entity/Car.php - About 2 hrs to fix

            Similar blocks of code found in 6 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/Version20200908120600.php and 5 other locations - About 2 hrs to fix
            api/src/Migrations/Version20190122154548.php on lines 34..50
            api/src/Migrations/Version20190430134441.php on lines 57..73
            api/src/Migrations/Version20200309120000.php on lines 21..37
            api/src/Migrations/Version20230224134452.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 31..47

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

            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 6 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/Version20230224134452.php and 5 other locations - About 2 hrs to fix
            api/src/Migrations/Version20190122154548.php on lines 34..50
            api/src/Migrations/Version20190430134441.php on lines 57..73
            api/src/Migrations/Version20200309120000.php on lines 21..37
            api/src/Migrations/Version20200908120600.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 31..47

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

            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 6 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/Version20200309120000.php and 5 other locations - About 2 hrs to fix
            api/src/Migrations/Version20190122154548.php on lines 34..50
            api/src/Migrations/Version20190430134441.php on lines 57..73
            api/src/Migrations/Version20200908120600.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 31..47

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

            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 6 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/Version20190430134441.php and 5 other locations - About 2 hrs to fix
            api/src/Migrations/Version20190122154548.php on lines 34..50
            api/src/Migrations/Version20200309120000.php on lines 21..37
            api/src/Migrations/Version20200908120600.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 31..47

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

            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 6 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/Version20230224134452.php and 5 other locations - About 2 hrs to fix
            api/src/Migrations/Version20190122154548.php on lines 34..50
            api/src/Migrations/Version20190430134441.php on lines 57..73
            api/src/Migrations/Version20200309120000.php on lines 21..37
            api/src/Migrations/Version20200908120600.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 13..29

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

            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 6 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/Version20190122154548.php and 5 other locations - About 2 hrs to fix
            api/src/Migrations/Version20190430134441.php on lines 57..73
            api/src/Migrations/Version20200309120000.php on lines 21..37
            api/src/Migrations/Version20200908120600.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 13..29
            api/src/Migrations/Version20230224134452.php on lines 31..47

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

            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 createStructureTerritory(array $tab)
                {
                    echo 'Link structure '.$tab[0].' with territory : '.$tab[1].PHP_EOL;
                    if ($structure = $this->structureManager->getStructure($tab[0])) {
                        if ($territory = $this->territoryManager->getTerritory($tab[1])) {
            Severity: Major
            Found in api/src/DataFixtures/Service/SolidaryFixturesManager.php and 1 other location - About 2 hrs to fix
            api/src/DataFixtures/Service/SolidaryFixturesManager.php on lines 273..287

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

            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 createStructureNeed(array $tab)
                {
                    echo 'Link structure '.$tab[0].' with Need : '.$tab[1].PHP_EOL;
                    if ($structure = $this->structureManager->getStructure($tab[0])) {
                        if ($need = $this->needRepository->find($tab[1])) {
            Severity: Major
            Found in api/src/DataFixtures/Service/SolidaryFixturesManager.php and 1 other location - About 2 hrs to fix
            api/src/DataFixtures/Service/SolidaryFixturesManager.php on lines 196..210

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

            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) 2020, MOBICOOP. All rights reserved.
             * This project is dual licensed under AGPL and proprietary licence.
            api/src/Geography/DataProvider/AddressCompletionCollectionDataProvider.php on lines 1..59

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

            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) 2020, MOBICOOP. All rights reserved.
             * This project is dual licensed under AGPL and proprietary licence.
            api/src/Geography/DataProvider/TerritoryLinkCollectionDataProvider.php on lines 1..59

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

            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

                                    if ($matching['request']->getProposalRequest()->getCriteria()->isWedCheck()
                                        && !is_null($matching['request']->getProposalRequest()->getCriteria()->getWedTime())) {
                                        $wedTime = $matching['request']->getProposalRequest()->getCriteria()->getWedTime();
                                        if ($pickupDuration) {
                                            $wedTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
            Severity: Major
            Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
            api/src/Carpool/Service/ResultManager.php on lines 1088..1097
            api/src/Carpool/Service/ResultManager.php on lines 1108..1117
            api/src/Carpool/Service/ResultManager.php on lines 1118..1127
            api/src/Carpool/Service/ResultManager.php on lines 1138..1147

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

            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

                                    if ($matching['request']->getProposalRequest()->getCriteria()->isTueCheck()
                                        && !is_null($matching['request']->getProposalRequest()->getCriteria()->getTueTime())) {
                                        $tueTime = $matching['request']->getProposalRequest()->getCriteria()->getTueTime();
                                        if ($pickupDuration) {
                                            $tueTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
            Severity: Major
            Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
            api/src/Carpool/Service/ResultManager.php on lines 1098..1107
            api/src/Carpool/Service/ResultManager.php on lines 1108..1117
            api/src/Carpool/Service/ResultManager.php on lines 1118..1127
            api/src/Carpool/Service/ResultManager.php on lines 1138..1147

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

            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

                                    if ($matching['request']->getProposalRequest()->getCriteria()->isThuCheck()
                                        && !is_null($matching['request']->getProposalRequest()->getCriteria()->getThuTime())) {
                                        $thuTime = $matching['request']->getProposalRequest()->getCriteria()->getThuTime();
                                        if ($pickupDuration) {
                                            $thuTime->sub(new \DateInterval('PT'.$pickupDuration.'S'));
            Severity: Major
            Found in api/src/Carpool/Service/ResultManager.php and 4 other locations - About 2 hrs to fix
            api/src/Carpool/Service/ResultManager.php on lines 1088..1097
            api/src/Carpool/Service/ResultManager.php on lines 1098..1107
            api/src/Carpool/Service/ResultManager.php on lines 1118..1127
            api/src/Carpool/Service/ResultManager.php on lines 1138..1147

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

            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