Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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

    public function getCollection(string $resourceClass, string $operationName = null, array $context = []): iterable
    {
        $manager = $this->managerRegistry->getManagerForClass($resourceClass);
        /**
         * @var EntityRepository $repository
api/src/Editorial/Admin/DataProvider/EditorialCollectionDataProvider.php on lines 58..75

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

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

WeekSchedule has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class WeekSchedule
{
    /*
    * WARNING : For now, Mobicoop only use the outward timeDelta and ignore the time delta of specific days
    */
Severity: Minor
Found in api/src/RdexPlus/Entity/WeekSchedule.php - About 3 hrs to fix

    Proof has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Proof
    {
        
        /**
         * @var int The id of this proof.
    Severity: Minor
    Found in api/src/Solidary/Entity/Proof.php - About 3 hrs to fix

      Territory has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Territory
      {
          /**
           * @var int the id of this territory
           *
      Severity: Minor
      Found in api/src/Geography/Entity/Territory.php - About 3 hrs to fix

        Need has 28 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Need
        {
            
            /**
             * @var int The id of this need.
        Severity: Minor
        Found in api/src/Solidary/Entity/Need.php - About 3 hrs to fix

          Direction has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Direction
          {
              /**
               * @var int The id of this direction.
               */
          Severity: Minor
          Found in client/src/MobicoopBundle/Geography/Entity/Direction.php - About 3 hrs to fix

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

            if not os.path.isfile(api_translations_path+"/messages+intl-icu."+lang+".yaml"):
                copyfile(api_translations_path+"/messages+intl-icu.en.yaml", api_translations_path+"/messages+intl-icu."+lang+".yaml")
            Severity: Major
            Found in scripts/createLang.py and 1 other location - About 3 hrs to fix
            scripts/createLang.py on lines 157..158

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

            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 not os.path.isfile(client_ui_path+"/ui."+lang+".yaml"):
                copyfile(client_ui_path+"/ui.en.yaml", client_ui_path+"/ui."+lang+".yaml")
            Severity: Major
            Found in scripts/createLang.py and 1 other location - About 3 hrs to fix
            scripts/createLang.py on lines 169..170

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

            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 _commitLDSubscription()
                {
                    $subscription = $this->_em->getRepository(LongDistanceSubscription::class)->find($this->_currentInput->getOption('subscription'));
            
                    if (is_null($subscription)) {
            Severity: Major
            Found in api/src/Incentive/Command/SubscriptionCommitCommand.php and 1 other location - About 3 hrs to fix
            api/src/Incentive/Command/SubscriptionCommitCommand.php on lines 69..87

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

            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 _commitSDSubscription()
                {
                    $subscription = $this->_em->getRepository(ShortDistanceSubscription::class)->find($this->_currentInput->getOption('subscription'));
            
                    if (is_null($subscription)) {
            Severity: Major
            Found in api/src/Incentive/Command/SubscriptionCommitCommand.php and 1 other location - About 3 hrs to fix
            api/src/Incentive/Command/SubscriptionCommitCommand.php on lines 49..67

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

            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

                            $currentThread['carpoolInfos'] = [
                                'askHistoryId' => $askHistory->getId(),
                                'origin' => $waypoints[0]->getAddress()->getAddressLocality(),
                                'destination' => $waypoints[count($waypoints) - 1]->getAddress()->getAddressLocality(),
                                'criteria' => [
            Severity: Major
            Found in api/src/User/Service/UserManager.php and 1 other location - About 3 hrs to fix
            api/src/User/Service/UserManager.php on lines 1039..1055

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

            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

                            $currentThread['carpoolInfos'] = [
                                'solidaryAskHistoryId' => $lastSolidaryAskHistory->getId(),
                                'origin' => $waypoints[0]->getAddress()->getAddressLocality(),
                                'destination' => $waypoints[count($waypoints) - 1]->getAddress()->getAddressLocality(),
                                'criteria' => [
            Severity: Major
            Found in api/src/User/Service/UserManager.php and 1 other location - About 3 hrs to fix
            api/src/User/Service/UserManager.php on lines 1145..1161

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

            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 ($matches = $this->geoMatcher->forceMatch($candidateDriver, $candidatePassenger)) {
                        // many matches can be found for 2 candidates : if multiple routes satisfy the criteria
                        if (is_array($matches) && count($matches) > 0) {
                            switch (self::MULTI_MATCHES_FOR_SAME_CANDIDATES) {
                                case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
            Severity: Major
            Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 hrs to fix
            api/src/Carpool/Service/ProposalMatcher.php on lines 159..181

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

            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 ($matches = $this->geoMatcher->forceMatch($candidateDriver, $candidatePassenger)) {
                        // many matches can be found for 2 candidates : if multiple routes satisfy the criteria
                        if (is_array($matches) && count($matches) > 0) {
                            switch (self::MULTI_MATCHES_FOR_SAME_CANDIDATES) {
                                case self::MULTI_MATCHES_FOR_SAME_CANDIDATES_FASTEST:
            Severity: Major
            Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 3 hrs to fix
            api/src/Carpool/Service/ProposalMatcher.php on lines 227..249

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

            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

            BankAccount has 27 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class BankAccount
            {
                public const STATUS_INACTIVE = 0;
                public const STATUS_ACTIVE = 1;
            
            
            Severity: Minor
            Found in api/src/Payment/Ressource/BankAccount.php - About 3 hrs to fix

              CarpoolController has 27 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class CarpoolController extends AbstractController
              {
                  use HydraControllerTrait;
              
                  private $midPrice;
              Severity: Minor
              Found in client/src/MobicoopBundle/Carpool/Controller/CarpoolController.php - About 3 hrs to fix

                RetroactivelyRewardService has 27 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class RetroactivelyRewardService
                {
                    public const GAMIFICATION_ACTION_DONE = [
                        1 => 'hasEmailValidated',
                        2 => 'hasPhoneValidated',
                Severity: Minor
                Found in api/src/Gamification/Service/RetroactivelyRewardService.php - About 3 hrs to fix

                  ProposalRepository has 27 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ProposalRepository
                  {
                      private $bearing_range;                   // if used, only accept proposal where the bearing direction (cape) is not at the opposite, more or less the range degrees
                      // for example, if the bearing is 0 (s->n), the proposals where the bearing is between 170 and 190 (~ n->s) are excluded
                      private $passenger_proportion;           // minimum passenger distance relative to the driver distance, eg passenger distance should be at least 30% of the driver distance
                  Severity: Minor
                  Found in api/src/Carpool/Repository/ProposalRepository.php - About 3 hrs to fix

                    CommunityManager has 27 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class CommunityManager
                    {
                        private $entityManager;
                        private $logger;
                        private $securityPath;
                    Severity: Minor
                    Found in api/src/Community/Service/CommunityManager.php - About 3 hrs to fix

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

                      class PTJourney
                      {
                          public const DEFAULT_ID = 999999999999;
                      
                          /**
                      Severity: Minor
                      Found in api/src/PublicTransport/Entity/PTJourney.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language