Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

Booking has 41 functions (exceeds 20 allowed). Consider refactoring.
Open

class Booking implements ResourceInterface, \JsonSerializable
{
    public const DEFAULT_ID = 999999999999;
    public const RESOURCE_NAME = 'carpool_standard/bookings';
    public const INITIATED = 'INITIATED';
Severity: Minor
Found in client/src/MobicoopBundle/CarpoolStandard/Entity/Booking.php - About 5 hrs to fix

    MassPerson has 41 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MassPerson implements ResourceInterface
    {
        /**
         * @var int The id of this person.
         */
    Severity: Minor
    Found in client/src/MobicoopBundle/Match/Entity/MassPerson.php - About 5 hrs to fix

      PaymentItem has 41 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class PaymentItem
      {
          const DEFAULT_ID = 999999999999;
      
          const FREQUENCY_PUNCTUAL = 1;
      Severity: Minor
      Found in api/src/Payment/Ressource/PaymentItem.php - About 5 hrs to fix

        Booking has 41 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Booking
        {
            public const DEFAULT_ID = 999999999999;
            public const INITIATED = 'INITIATED';
            public const WAITING_PASSENGER_CONFIRMATION = 'WAITING_PASSENGER_CONFIRMATION';
        Severity: Minor
        Found in api/src/CarpoolStandard/Entity/Booking.php - About 5 hrs to fix

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

              public function transferWalletToWallet(string $debtorIdentifier, Wallet $walletFrom, Wallet $walletTo, float $amount, string $tag = ''): ?string
              {
                  $body = [
                      'AuthorId' => $debtorIdentifier,
                      'DebitedFunds' => [
          Severity: Major
          Found in api/src/DataProvider/Entity/MangoPayProvider.php and 1 other location - About 5 hrs to fix
          api/src/DataProvider/Entity/MangoPayProvider.php on lines 698..727

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

          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 triggerPayout(string $authorIdentifier, Wallet $wallet, BankAccount $bankAccount, float $amount, string $reference = ''): ?string
              {
                  $body = [
                      'AuthorId' => $authorIdentifier,
                      'DebitedFunds' => [
          Severity: Major
          Found in api/src/DataProvider/Entity/MangoPayProvider.php and 1 other location - About 5 hrs to fix
          api/src/DataProvider/Entity/MangoPayProvider.php on lines 664..693

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

          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

                  foreach ($proposalsDriver as $proposalDriver) {
                      // we have to check for an existing outward for a return proposal => we keep only outward
                      if (Proposal::TYPE_RETURN == $proposalDriver->getType()) {
                          $foundOutward = false;
                          foreach ($proposalsDriver as $proposal) {
          Severity: Major
          Found in api/src/Carpool/Repository/ProposalRepository.php and 1 other location - About 5 hrs to fix
          api/src/Carpool/Repository/ProposalRepository.php on lines 1094..1133

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

          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 (!is_null($carpoolProof->getPickUpDriverAddress())) {
                              // the driver has set its pickup
                              if (!is_null($carpoolProof->getDropOffDriverAddress())) {
                                  // the driver has already certified its pickup and dropoff
                                  throw new ProofException('The driver has already sent its dropoff certification');
          Severity: Major
          Found in api/src/Carpool/Service/ProofManager.php and 1 other location - About 5 hrs to fix
          api/src/Carpool/Service/ProofManager.php on lines 496..557

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

          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 (!is_null($carpoolProof->getPickUpPassengerAddress())) {
                              // the passenger has set its pickup
                              if (!is_null($carpoolProof->getDropOffPassengerAddress())) {
                                  // the passenger has already certified its pickup and dropoff
                                  throw new ProofException('The passenger has already sent its dropoff certification');
          Severity: Major
          Found in api/src/Carpool/Service/ProofManager.php and 1 other location - About 5 hrs to fix
          api/src/Carpool/Service/ProofManager.php on lines 434..486

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

          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

                  foreach ($proposalsPassenger as $proposalPassenger) {
                      // we have to check for an existing outward for a return proposal => we keep only outward
                      if (Proposal::TYPE_RETURN == $proposalPassenger->getType()) {
                          $foundOutward = false;
                          foreach ($proposalsPassenger as $proposal) {
          Severity: Major
          Found in api/src/Carpool/Repository/ProposalRepository.php and 1 other location - About 5 hrs to fix
          api/src/Carpool/Repository/ProposalRepository.php on lines 1053..1092

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

          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

                          $element = [
                              'id' => $proposalFound['wid'],
                              'position' => $proposalFound['position'],
                              'destination' => $proposalFound['destination'],
                              'reached' => $proposalFound['reached'],
          Severity: Major
          Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 5 hrs to fix
          api/src/Carpool/Service/ProposalMatcher.php on lines 294..316

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

          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

                                  [
                                      'id' => $proposalFound['wid'],
                                      'position' => $proposalFound['position'],
                                      'destination' => $proposalFound['destination'],
                                      'reached' => $proposalFound['reached'],
          Severity: Major
          Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 5 hrs to fix
          api/src/Carpool/Service/ProposalMatcher.php on lines 320..342

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

          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

          class Iframe
          {
              /**
               * @var string title of the iframe
               */
          Severity: Major
          Found in api/src/Article/Entity/Iframe.php and 1 other location - About 5 hrs to fix
          client/src/MobicoopBundle/Communication/Entity/Report.php on lines 35..125

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

          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

          class Report implements ResourceInterface
          {
              /**
               * @var int The id of the Report
               */
          Severity: Major
          Found in client/src/MobicoopBundle/Communication/Entity/Report.php and 1 other location - About 5 hrs to fix
          api/src/Article/Entity/Iframe.php on lines 29..115

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

          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

          Badge has 40 functions (exceeds 20 allowed). Consider refactoring.
          Open

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

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

            <?php
            /**
             * Copyright (c) 2019, MOBICOOP. All rights reserved.
             * This project is dual licensed under AGPL and proprietary licence.
             ***************************
            Severity: Major
            Found in api/src/User/Filter/EmailTokenFilter.php and 1 other location - About 5 hrs to fix
            api/src/User/Filter/LoginFilter.php on lines 1..68

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

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

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

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

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

            Refactorings

            Further Reading

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

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

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

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

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

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

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

            Refactorings

            Further Reading

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

            <?php
            
            /**
             * Copyright (c) 2018, MOBICOOP. All rights reserved.
             * This project is dual licensed under AGPL and proprietary licence.
            api/src/PublicTransport/Entity/PTLocality.php on lines 1..145

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

            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) 2019, MOBICOOP. All rights reserved.
             * This project is dual licensed under AGPL and proprietary licence.
             ***************************
            Severity: Major
            Found in api/src/User/Filter/LoginFilter.php and 1 other location - About 5 hrs to fix
            api/src/User/Filter/EmailTokenFilter.php on lines 1..68

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

            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 getTo(string $destination, string $operationName, array $context = [])
                {
                    // first we search the city in the journeys as destination
                    $conn = $this->entityManager->getConnection();
                    $sql = "SELECT * FROM journey WHERE LOWER(LEFT(TRIM(destination),1)) like '".strtolower(substr($destination, 0, 1))."'";
            Severity: Major
            Found in api/src/Journey/Service/JourneyManager.php and 1 other location - About 5 hrs to fix
            api/src/Journey/Service/JourneyManager.php on lines 232..250

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

            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