Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

PaymentManager has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class PaymentManager
{
    public const MIN_WEEK = 1;
    public const MAX_WEEK = 52;
    public const MIN_YEAR = 1970;
Severity: Minor
Found in api/src/Payment/Service/PaymentManager.php - About 3 hrs to fix

    Tools has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Tools
    {
        public const POSITION_ORIGIN = 'origin';
        public const POSITION_DESTINATION = 'destination';
    
    
    Severity: Minor
    Found in api/src/DataProvider/Service/RPCv3/Tools.php - About 3 hrs to fix

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

      <?php
      
      /**
       * Copyright (c) 2020, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      api/src/Community/DataProvider/CommunityUserAvailableCollectionDataProvider.php on lines 1..58
      api/src/Event/DataProvider/EventAdsCollectionDataProvider.php on lines 1..58
      api/src/Import/DataProvider/RedirectSearchCollectionDataProvider.php on lines 1..58

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

      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
      
      /**
       * Copyright (c) 2019, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      api/src/Event/DataProvider/EventAdsCollectionDataProvider.php on lines 1..58
      api/src/Event/DataProvider/EventIsCreatedByUserCollectionDataProvider.php on lines 1..58
      api/src/Import/DataProvider/RedirectSearchCollectionDataProvider.php on lines 1..58

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

      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
      
      /**
       * Copyright (c) 2020, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      api/src/Community/DataProvider/CommunityUserAvailableCollectionDataProvider.php on lines 1..58
      api/src/Event/DataProvider/EventIsCreatedByUserCollectionDataProvider.php on lines 1..58
      api/src/Import/DataProvider/RedirectSearchCollectionDataProvider.php on lines 1..58

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

      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
      
      /**
       * Copyright (c) 2020, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      api/src/Community/DataProvider/CommunityUserAvailableCollectionDataProvider.php on lines 1..58
      api/src/Event/DataProvider/EventAdsCollectionDataProvider.php on lines 1..58
      api/src/Event/DataProvider/EventIsCreatedByUserCollectionDataProvider.php on lines 1..58

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

      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

          private function importEventIfNotMigrate()
          {
              if (($handle = fopen("../public/import/csv/event_id_corresp.csv", "r")) !== false) {
                  while (($data = fgetcsv($handle, 1000, ",")) !== false) {
                      $importEvent = new EventImport();
      Severity: Major
      Found in api/src/Import/Service/ImportManager.php and 1 other location - About 2 hrs to fix
      api/src/Import/Service/ImportManager.php on lines 476..491

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

      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

          private function importCommunityIfNotMigrate()
          {
              if (($handle = fopen("../public/import/csv/community_id_corresp.csv", "r")) !== false) {
                  while (($data = fgetcsv($handle, 1000, ",")) !== false) {
                      $importCommunity = new CommunityImport();
      Severity: Major
      Found in api/src/Import/Service/ImportManager.php and 1 other location - About 2 hrs to fix
      api/src/Import/Service/ImportManager.php on lines 496..511

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

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

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

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

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

      Refactorings

      Further Reading

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

              if ($adManager->claimAd($id)) {
                  $ad = $adManager->getAd($id);
      
                  $origin = $this->__originDisplay($ad->getOutwardWaypoints());
                  $destination = $this->__destinationDisplay($ad->getOutwardWaypoints());
      client/src/MobicoopBundle/Carpool/Controller/CarpoolController.php on lines 428..449

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

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

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

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

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

      Refactorings

      Further Reading

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

          public function carpoolAdResults($id, AdManager $adManager)
          {
              $ad = $adManager->getAd($id);
      
              $origin = $this->__originDisplay($ad->getOutwardWaypoints());
      client/src/MobicoopBundle/Carpool/Controller/CarpoolController.php on lines 460..480

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

      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 getMultipleAsyncRoutes(array $addresses, bool $detailDuration=false, bool $pointsOnly = false, ?int $returnType = null, ?bool $avoidToll = null): ?array
          {
              $this->router->setDetailDuration($detailDuration);
              $this->router->setPointsOnly($pointsOnly);
              if (!is_null($returnType)) {
      Severity: Major
      Found in api/src/Geography/Service/GeoRouter.php and 2 other locations - About 2 hrs to fix
      api/src/Geography/Service/GeoRouter.php on lines 77..88
      api/src/Geography/Service/GeoRouter.php on lines 100..111

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

      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

                      try {
                          $clientResponse = $this->client->post($this->authLoginPath, [
                              'headers' => ['accept' => 'application/json'],
                              RequestOptions::JSON => [
                                  'email' => $this->username,
      Severity: Major
      Found in client/src/MobicoopBundle/Api/Service/DataProvider.php and 1 other location - About 2 hrs to fix
      client/src/MobicoopBundle/Api/Service/DataProvider.php on lines 1075..1093

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

      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 getAsyncRoutes(array $addresses, bool $detailDuration=false, bool $pointsOnly = false, ?int $returnType = null, ?bool $avoidToll = null): ?array
          {
              $this->router->setDetailDuration($detailDuration);
              $this->router->setPointsOnly($pointsOnly);
              if (!is_null($returnType)) {
      Severity: Major
      Found in api/src/Geography/Service/GeoRouter.php and 2 other locations - About 2 hrs to fix
      api/src/Geography/Service/GeoRouter.php on lines 77..88
      api/src/Geography/Service/GeoRouter.php on lines 125..136

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

      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 getRoutes(array $addresses, bool $detailDuration=false, bool $pointsOnly = false, ?int $returnType = null, ?bool $avoidToll = null): ?array
          {
              $this->router->setDetailDuration($detailDuration);
              $this->router->setPointsOnly($pointsOnly);
              if (!is_null($returnType)) {
      Severity: Major
      Found in api/src/Geography/Service/GeoRouter.php and 2 other locations - About 2 hrs to fix
      api/src/Geography/Service/GeoRouter.php on lines 100..111
      api/src/Geography/Service/GeoRouter.php on lines 125..136

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

      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

                      try {
                          $clientResponse = $this->client->post($this->authLoginPath, [
                              'headers' => ['accept' => 'application/json'],
                              RequestOptions::JSON => [
                                  'username' => $this->username,
      Severity: Major
      Found in client/src/MobicoopBundle/Api/Service/DataProvider.php and 1 other location - About 2 hrs to fix
      client/src/MobicoopBundle/Api/Service/DataProvider.php on lines 986..1003

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

      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

      Action has 25 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Action
      {
          public const TYPE_AUTO = 0;
          public const TYPE_TAKING_ACCOUNT_ASK = 1;
          public const TYPE_SOLUTION_FINDING = 2;
      Severity: Minor
      Found in api/src/Action/Entity/Action.php - About 2 hrs to fix

        PTJourney has 25 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PTJourney
        {
            /**
             * @var int the id of this journey
             */
        Severity: Minor
        Found in client/src/MobicoopBundle/PublicTransport/Entity/PTJourney.php - About 2 hrs to fix

          RelayPointMap has 25 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class RelayPointMap
          {
              public const DEFAULT_ID = 999999999999;
              public const IMAGE_PATH = 'relaypoints/images/versions';
              public const IMAGE_VERSION = 100;
          Severity: Minor
          Found in api/src/RelayPoint/Resource/RelayPointMap.php - About 2 hrs to fix

            SolidaryAsk has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class SolidaryAsk
            {
                const STATUS_ASKED = 0;
                const STATUS_REFUSED = 1;
                const STATUS_PENDING = 2;
            Severity: Minor
            Found in api/src/Solidary/Entity/SolidaryAsk.php - About 2 hrs to fix

              MobConnectAuth has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class MobConnectAuth
              {
                  /**
                   * @var int The user subscription ID
                   *
              Severity: Minor
              Found in api/src/Incentive/Entity/MobConnectAuth.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language