Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

SsoConnection has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class SsoConnection
{
    public const DEFAULT_ID = 999999999999;

    public const RETURN_URL = 'user/sso/login';
Severity: Minor
Found in api/src/User/Ressource/SsoConnection.php - About 2 hrs to fix

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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    api/src/Solidary/DataPersister/SolidaryFormalRequestDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidarySolutionDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserStructureDataPersister.php on lines 1..59

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 131.

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

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

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

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

    Refactorings

    Further Reading

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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    api/src/Solidary/DataPersister/SolidaryContactDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidaryFormalRequestDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidaryUserDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserStructureDataPersister.php on lines 1..59

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 131.

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

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

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

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

    Refactorings

    Further Reading

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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    api/src/Solidary/DataPersister/SolidaryContactDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidaryFormalRequestDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidarySolutionDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserStructureDataPersister.php on lines 1..59

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 131.

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

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

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

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

    Refactorings

    Further Reading

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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    api/src/Solidary/DataPersister/SolidaryContactDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidaryFormalRequestDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidarySolutionDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserDataPersister.php on lines 1..59

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 131.

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

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

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

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

    Refactorings

    Further Reading

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

    <?php
    /**
     * Copyright (c) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
     ***************************
    api/src/Solidary/DataPersister/SolidaryContactDataPersister.php on lines 1..58
    api/src/Solidary/DataPersister/SolidarySolutionDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserDataPersister.php on lines 1..59
    api/src/Solidary/DataPersister/SolidaryUserStructureDataPersister.php on lines 1..59

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 131.

    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

                    case Booking::class:
                        if ($recipient->getId() == $object->getPassenger()->getId()) {
                            $senderAlias = $object->getDriver()->getAlias();
                            $senderOperator = $object->getDriver()->getOperator();
                        } elseif ($recipient->getId() == $object->getDriver()->getId()) {
    Severity: Major
    Found in api/src/Communication/Service/NotificationManager.php and 1 other location - About 2 hrs to fix
    api/src/Communication/Service/NotificationManager.php on lines 692..708

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

    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

                    case Booking::class:
                        if ($recipient->getId() == $object->getPassenger()->getId()) {
                            $senderAlias = $object->getDriver()->getAlias();
                            $senderOperator = $object->getDriver()->getOperator();
                        } elseif ($recipient->getId() == $object->getDriver()->getId()) {
    Severity: Major
    Found in api/src/Communication/Service/NotificationManager.php and 1 other location - About 2 hrs to fix
    api/src/Communication/Service/NotificationManager.php on lines 1188..1204

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

    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) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/PublicTransport/Repository/PTJourneyRepository.php and 2 other locations - About 2 hrs to fix
    api/src/Match/Repository/MassMatchingRepository.php on lines 1..62
    api/src/Match/Repository/MassPTJourneyRepository.php on lines 1..61

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

    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) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/Match/Repository/MassPTJourneyRepository.php and 2 other locations - About 2 hrs to fix
    api/src/Match/Repository/MassMatchingRepository.php on lines 1..62
    api/src/PublicTransport/Repository/PTJourneyRepository.php on lines 1..61

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

    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

                        switch ($day) {
                            case 'sun': $arrivalProposalTime = $sameDayProposal->getCriteria()->getArrivalSunTime();
    
                                break;
    
    
    Severity: Major
    Found in api/src/Carpool/Service/AntiFraudManager.php and 1 other location - About 2 hrs to fix
    api/src/Carpool/Service/AntiFraudManager.php on lines 593..621

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

    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) 2020, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/Match/Repository/MassMatchingRepository.php and 2 other locations - About 2 hrs to fix
    api/src/Match/Repository/MassPTJourneyRepository.php on lines 1..61
    api/src/PublicTransport/Repository/PTJourneyRepository.php on lines 1..61

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

    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

                    switch ($dayOfTheAd) {
                        case 'Sun': $arrivalTime = $sameDayProposal->getCriteria()->getArrivalSunTime();
    
                            break;
    
    
    Severity: Major
    Found in api/src/Carpool/Service/AntiFraudManager.php and 1 other location - About 2 hrs to fix
    api/src/Carpool/Service/AntiFraudManager.php on lines 476..504

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

    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

            } elseif (Criteria::FREQUENCY_PUNCTUAL == $solidary->getAdminfrequency()) {
                // set time for punctual proposal
                $solidary->setAdminoutwardMinTime($solidary->getProposal()->getCriteria()->getMinTime());
                $solidary->setAdminoutwardTime($solidary->getProposal()->getCriteria()->getFromTime());
                $solidary->setAdminoutwardMaxTime($solidary->getProposal()->getCriteria()->getMaxTime());
    Severity: Major
    Found in api/src/Solidary/Admin/Service/SolidaryManager.php and 1 other location - About 2 hrs to fix
    api/src/Solidary/Admin/Service/SolidaryManager.php on lines 207..228

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

    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 (Criteria::FREQUENCY_FLEXIBLE == $solidary->getAdminfrequency()) {
                // set min and max time for flexible proposal
                // for a flexible proposal, we have only one schedule, with all days checked
                $solidary->setAdminoutwardMinTime($solidary->getProposal()->getCriteria()->getMonMinTime());
                $solidary->setAdminoutwardTime($solidary->getProposal()->getCriteria()->getMonTime());
    Severity: Major
    Found in api/src/Solidary/Admin/Service/SolidaryManager.php and 1 other location - About 2 hrs to fix
    api/src/Solidary/Admin/Service/SolidaryManager.php on lines 218..228

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

    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

    Search has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Search implements \JsonSerializable
    {
        public const DEFAULT_SEATS_PASSENGER = 1;
        public const DEFAULT_SEATS_DRIVER = 3;
    
    
    Severity: Minor
    Found in api/src/Carpool/Entity/MobicoopMatcher/Search.php - About 2 hrs to fix

      Subject has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

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

        Section has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Section
        {
            const STATUS_PENDING = 0;
            const STATUS_PUBLISHED = 1;
            
        Severity: Minor
        Found in api/src/Article/Entity/Section.php - About 2 hrs to fix

          Candidate has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Candidate
          {
              /**
               * @var int the id of this candidate
               */
          Severity: Minor
          Found in api/src/Match/Entity/Candidate.php - About 2 hrs to fix

            EecEligibility has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class EecEligibility
            {
                public const DEFAULT_ID = '999999999999';
                public const LONG_DISTANCE_ELIGIBILITY_THRESHOLD = 0;
                public const SHORT_DISTANCE_ELIGIBILITY_THRESHOLD = 0;
            Severity: Minor
            Found in api/src/Incentive/Resource/EecEligibility.php - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language