Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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

class UserSubscriber implements EventSubscriberInterface
{
    private $notificationManager;
    private $userManager;
    private $adminUserManager;
Severity: Minor
Found in api/src/Communication/EventSubscriber/UserSubscriber.php - About 2 hrs to fix

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

    class MassPTJourney
    {
        /**
         * @var int The id of this journey.
         * @ORM\Id
    Severity: Minor
    Found in api/src/Match/Entity/MassPTJourney.php - About 2 hrs to fix

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

      class BankTransfer
      {
          public const DEFAULT_ID = '999999999999';
      
          public const STATUS_INVALID = 0;
      Severity: Minor
      Found in api/src/Payment/Entity/BankTransfer.php - About 2 hrs to fix

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

        class SolidaryAnimation
        {
            const DEFAULT_ID = 999999999999;
        
            /**
        Severity: Minor
        Found in api/src/Solidary/Entity/SolidaryAnimation.php - About 2 hrs to fix

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

          class User
          {
              public const DEFAULT_ID = 999999999999;
          
              public const GENDER_FEMALE = 1;
          Severity: Minor
          Found in api/src/User/Interoperability/Ressource/User.php - About 2 hrs to fix

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

                public function carpoolSolidaryExclusiveAdPost()
                {
                    $ad = new Ad();
                    $this->denyAccessUnlessGranted('create_ad', $ad);
            
            
            client/src/MobicoopBundle/Carpool/Controller/CarpoolController.php on lines 293..315

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

            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 carpoolFirstAdPost()
                {
                    $ad = new Ad();
                    $this->denyAccessUnlessGranted('create_first_ad', $ad);
            
            
            client/src/MobicoopBundle/Carpool/Controller/CarpoolController.php on lines 320..345

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

            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 onCommunityMember(CommunityNewMemberEvent $event)
                {
                    // the recipient is the new community member
                    $communityCreator = $event->getCommunityUser()->getCommunity()->getUser();
            
            
            api/src/Communication/EventSubscriber/CommunitySubscriber.php on lines 66..83

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

            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 onCommunityNewMembershipRequest(CommunityNewMembershipRequestEvent $event)
                {
                    // the recipient is the creator of community
                    $communityCreator = $event->getCommunityUser()->getCommunity()->getUser();
            
            
            api/src/Communication/EventSubscriber/CommunitySubscriber.php on lines 88..105

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isWedCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getWedMinTime(), $criteria->getWedMaxTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Wed = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 186..195
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 196..205
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 216..225
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 226..235
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 236..245
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 246..255

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isThuCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getThuMinTime(), $criteria->getThuMaxTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Thu = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 186..195
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 196..205
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 206..215
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 226..235
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 236..245
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 246..255

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isSunCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getSunMinTime(), $criteria->getSunMaxTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Sun = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 186..195
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 196..205
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 206..215
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 216..225
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 226..235
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 236..245

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isFriCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getFriMinTime(), $criteria->getFriMinTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Fri = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 186..195
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 196..205
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 206..215
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 216..225
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 236..245
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 246..255

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isSatCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getSatMinTime(), $criteria->getSatMaxTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Sat = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 186..195
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 196..205
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 206..215
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 216..225
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 226..235
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 246..255

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isMonCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getMonMinTime(), $criteria->getMonMaxTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Mon = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 196..205
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 206..215
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 216..225
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 226..235
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 236..245
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 246..255

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

            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 7 locations. Consider refactoring.
            Open

                        if ($criteria->isTueCheck()) {
                            $slot = $this->solidaryMatcher->getHourSlot($criteria->getTueMinTime(), $criteria->getTueMaxTime(), $structure);
                            if (self::USE_DAY_RESTRICTION) {
                                $query->andWhere('su.'.$slot.'Tue = 1');
                            }
            Severity: Major
            Found in api/src/Solidary/Repository/SolidaryUserRepository.php and 6 other locations - About 2 hrs to fix
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 186..195
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 206..215
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 216..225
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 226..235
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 236..245
            api/src/Solidary/Repository/SolidaryUserRepository.php on lines 246..255

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

            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

                        foreach ($matching->getFilters()['route'] as $key => $point) {
                            $waypoint = new Waypoint();
                            $waypoint->setPosition($key);
                            $waypoint->setDestination(false);
                            if ($key == (count($matching->getFilters()['route']) - 1)) {
            Severity: Major
            Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 2 hrs to fix
            api/src/Carpool/Service/ProposalMatcher.php on lines 1281..1292

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

            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

                            foreach ($matching->getFilters()['route'] as $key => $point) {
                                $waypoint = new Waypoint();
                                $waypoint->setPosition($key);
                                $waypoint->setDestination(false);
                                if ($key == (count($matching->getFilters()['route']) - 1)) {
            Severity: Major
            Found in api/src/Carpool/Service/ProposalMatcher.php and 1 other location - About 2 hrs to fix
            api/src/Carpool/Service/ProposalMatcher.php on lines 619..630

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

            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

                protected function supports($attribute, $subject)
                {
                    // if the attribute isn't one we support, return false
                    if (!in_array($attribute, [
                        self::REPORT_CREATE,
            Severity: Major
            Found in api/src/Communication/Security/ReportVoter.php and 1 other location - About 2 hrs to fix
            api/src/Match/Security/MassVoter.php on lines 55..77

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

            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

                protected function supports($attribute, $subject)
                {
                    // if the attribute isn't one we support, return false
                    if (!in_array($attribute, [
                        self::MASS_CREATE,
            Severity: Major
            Found in api/src/Match/Security/MassVoter.php and 1 other location - About 2 hrs to fix
            api/src/Communication/Security/ReportVoter.php on lines 46..69

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

            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