Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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 client/src/MobicoopBundle/Solidary/Entity/Subject.php and 1 other location - About 6 hrs to fix
client/src/MobicoopBundle/Solidary/Entity/Structure.php on lines 1..126

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

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

UserManager has 48 functions (exceeds 20 allowed). Consider refactoring.
Open

class UserManager
{
    private $dataProvider;
    private $encoder;
    private $tokenStorage;
Severity: Minor
Found in client/src/MobicoopBundle/User/Service/UserManager.php - About 6 hrs to fix

    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/Article/Repository/ParagraphRepository.php and 1 other location - About 6 hrs to fix
    api/src/Article/Repository/SectionRepository.php on lines 1..90

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

    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/Article/Repository/SectionRepository.php and 1 other location - About 6 hrs to fix
    api/src/Article/Repository/ParagraphRepository.php on lines 1..90

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

    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 geocodeQuery(GeocodeQuery $query): Collection
        {
            $address = $query->getText();
            $url = sprintf($this->uri . self::GEOCODE_ENDPOINT_URL, urlencode($address), $query->getLimit(), $query->getLocale());
            if (!is_null($query->getData('userPrioritize'))) {
    Severity: Major
    Found in api/src/Geography/ProviderFactory/PeliasSearch.php and 1 other location - About 6 hrs to fix
    api/src/Geography/ProviderFactory/PeliasAutocomplete.php on lines 79..90

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

    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 geocodeQuery(GeocodeQuery $query): Collection
        {
            $address = $query->getText();
            $url = sprintf($this->uri . self::GEOCODE_ENDPOINT_URL, urlencode($address), $query->getLimit(), $query->getLocale());
            if (!is_null($query->getData('userPrioritize'))) {
    Severity: Major
    Found in api/src/Geography/ProviderFactory/PeliasAutocomplete.php and 1 other location - About 6 hrs to fix
    api/src/Geography/ProviderFactory/PeliasSearch.php on lines 79..90

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

    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 findPunctualAdWithoutAskSinceXDays(?int $nbOfDays = null): ?array
        {
            $now = (new \DateTime('now'));
            $createdDate = $now->modify('-'.$nbOfDays.' days')->format('Y-m-d');
    
    
    Severity: Major
    Found in api/src/Carpool/Repository/ProposalRepository.php and 1 other location - About 6 hrs to fix
    api/src/Carpool/Repository/ProposalRepository.php on lines 1462..1510

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

    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 findRegularAdWithoutAskSinceXDays(?int $nbOfDays = null): ?array
        {
            $now = (new \DateTime('now'));
            $createdDate = $now->modify('-'.$nbOfDays.' days')->format('Y-m-d');
    
    
    Severity: Major
    Found in api/src/Carpool/Repository/ProposalRepository.php and 1 other location - About 6 hrs to fix
    api/src/Carpool/Repository/ProposalRepository.php on lines 1412..1460

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

    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

    SolidaryBeneficiary has 47 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SolidaryBeneficiary
    {
        const DEFAULT_ID = 999999999999;
        const TYPE = "beneficiary";
        const AUTHORIZED_GENERIC_FILTERS = ['familyName','givenName','email'];
    Severity: Minor
    Found in api/src/Solidary/Entity/SolidaryBeneficiary.php - About 6 hrs to fix

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

      <?php declare(strict_types=1);
      
      namespace DoctrineMigrations;
      
      use Doctrine\DBAL\Schema\Schema;
      Severity: Major
      Found in api/src/Migrations/Version20230306071924.php and 2 other locations - About 6 hrs to fix
      api/src/Migrations/Version20181001130100.php on lines 1..61
      api/src/Migrations/Version20210804100333.php on lines 1..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 214.

      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

      <?php declare(strict_types=1);
      
      namespace DoctrineMigrations;
      
      use Doctrine\DBAL\Schema\Schema;
      Severity: Major
      Found in api/src/Migrations/Version20210804100333.php and 2 other locations - About 6 hrs to fix
      api/src/Migrations/Version20181001130100.php on lines 1..61
      api/src/Migrations/Version20230306071924.php on lines 1..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 214.

      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

      <?php declare(strict_types=1);
      
      /**
       * Copyright (c) 2018, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
      Severity: Major
      Found in api/src/Migrations/Version20181001130100.php and 2 other locations - About 6 hrs to fix
      api/src/Migrations/Version20210804100333.php on lines 1..40
      api/src/Migrations/Version20230306071924.php on lines 1..40

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 214.

      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

      <?php
      /**
       * Copyright (c) 2021, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
       ***************************
      api/src/Event/Filter/EventAddressTerritoryFilter.php on lines 1..73
      api/src/RelayPoint/Filter/RelayPointAddressTerritoryFilter.php on lines 1..73

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

      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

      <?php
      /**
       * Copyright (c) 2021, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
       ***************************
      Severity: Major
      Found in api/src/Event/Filter/EventAddressTerritoryFilter.php and 2 other locations - About 6 hrs to fix
      api/src/Community/Filter/CommunityAddressTerritoryFilter.php on lines 1..74
      api/src/RelayPoint/Filter/RelayPointAddressTerritoryFilter.php on lines 1..73

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

      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.
      Severity: Major
      Found in api/src/ExternalJourney/Security/ExternalJourneyVoter.php and 1 other location - About 6 hrs to fix
      api/src/ExternalJourney/Security/ExternalConnectionVoter.php on lines 1..79

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

      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

      <?php
      /**
       * Copyright (c) 2021, MOBICOOP. All rights reserved.
       * This project is dual licensed under AGPL and proprietary licence.
       ***************************
      api/src/Community/Filter/CommunityAddressTerritoryFilter.php on lines 1..74
      api/src/Event/Filter/EventAddressTerritoryFilter.php on lines 1..73

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

      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.
      Severity: Major
      Found in api/src/ExternalJourney/Security/ExternalConnectionVoter.php and 1 other location - About 6 hrs to fix
      api/src/ExternalJourney/Security/ExternalJourneyVoter.php on lines 1..79

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

      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

      Subscription has 46 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class Subscription
      {
          public const TYPE_LONG = 'long';
          public const TYPE_SHORT = 'short';
      
      
      Severity: Minor
      Found in api/src/Incentive/Entity/Subscription.php - About 6 hrs to fix

        Journey has 46 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Journey
        {
            const DEFAULT_ID = 999999999999;
            
            const FREQUENCY_PUNCTUAL = 1;
        Severity: Minor
        Found in api/src/Journey/Entity/Journey.php - About 6 hrs to fix

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

              public function jsonSerialize()
              {
                  return
                   [
                       'id' => $this->getId(),
          Severity: Major
          Found in client/src/MobicoopBundle/Geography/Entity/Address.php and 1 other location - About 6 hrs to fix
          client/src/MobicoopBundle/Journey/Entity/Journey.php on lines 479..509

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

          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