DerDu/SPHERE-Framework

View on GitHub
Application/Reporting/CheckList/Service.php

Summary

Maintainability
F
1 mo
Test Coverage

Function createCheckListExcel has a Cognitive Complexity of 486 (exceeds 5 allowed). Consider refactoring.
Open

    public function createCheckListExcel(
        TblList $tblList,
        $YearPersonId = null,
        $LevelPersonId = null,
        $SchoolOption1Id = null,
Severity: Minor
Found in Application/Reporting/CheckList/Service.php - About 1 wk to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function filterObjectList has a Cognitive Complexity of 284 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterObjectList($objectList, $filterYear, $filterLevel, $filterSchoolOption1, $filterSchoolOption2)
    {

        $resultList = array();

Severity: Minor
Found in Application/Reporting/CheckList/Service.php - About 5 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File Service.php has 984 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php


namespace SPHERE\Application\Reporting\CheckList;

Severity: Major
Found in Application/Reporting/CheckList/Service.php - About 2 days to fix

    Function updateListObjectElementList has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updateListObjectElementList(
            IFormInterface $Stage = null,
            $Id = null,
            $Data = null,
            $HasData = null,
    Severity: Minor
    Found in Application/Reporting/CheckList/Service.php - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method createCheckListExcel has 258 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function createCheckListExcel(
            TblList $tblList,
            $YearPersonId = null,
            $LevelPersonId = null,
            $SchoolOption1Id = null,
    Severity: Major
    Found in Application/Reporting/CheckList/Service.php - About 1 day to fix

      Function getObjectList has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getObjectList($tblListObjectListByList, $objectList)
          {
              if ($tblListObjectListByList) {
                  /** @var TblListObjectElementList $tblListObjectList */
                  foreach ($tblListObjectListByList as $tblListObjectList) {
      Severity: Minor
      Found in Application/Reporting/CheckList/Service.php - About 7 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      class Service extends AbstractService
      {
      
          /**
           * @param bool $doSimulation
      Severity: Minor
      Found in Application/Reporting/CheckList/Service.php - About 5 hrs to fix

        Method filterObjectList has 116 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function filterObjectList($objectList, $filterYear, $filterLevel, $filterSchoolOption1, $filterSchoolOption2)
            {
        
                $resultList = array();
        
        
        Severity: Major
        Found in Application/Reporting/CheckList/Service.php - About 4 hrs to fix

          Function updateListObjectElement has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

              public function updateListObjectElement(
                  IFormInterface $Stage = null,
                  TblList $tblList = null,
                  TblObjectType $tblObjectType = null,
                  $ObjectId = null,
          Severity: Minor
          Found in Application/Reporting/CheckList/Service.php - About 4 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method updateListObjectElementList has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateListObjectElementList(
                  IFormInterface $Stage = null,
                  $Id = null,
                  $Data = null,
                  $HasData = null,
          Severity: Major
          Found in Application/Reporting/CheckList/Service.php - About 3 hrs to fix

            Method updateListObjectElement has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function updateListObjectElement(
                    IFormInterface $Stage = null,
                    TblList $tblList = null,
                    TblObjectType $tblObjectType = null,
                    $ObjectId = null,
            Severity: Major
            Found in Application/Reporting/CheckList/Service.php - About 2 hrs to fix

              Method getObjectList has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getObjectList($tblListObjectListByList, $objectList)
                  {
                      if ($tblListObjectListByList) {
                          /** @var TblListObjectElementList $tblListObjectList */
                          foreach ($tblListObjectListByList as $tblListObjectList) {
              Severity: Minor
              Found in Application/Reporting/CheckList/Service.php - About 1 hr to fix

                Method updateListObjectElement has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        IFormInterface $Stage = null,
                        TblList $tblList = null,
                        TblObjectType $tblObjectType = null,
                        $ObjectId = null,
                        $Data = null,
                Severity: Major
                Found in Application/Reporting/CheckList/Service.php - About 1 hr to fix

                  Method addElementToList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function addElementToList(IFormInterface $Stage = null, $Id, $Element)
                      {
                  
                          /**
                           * Skip to Frontend
                  Severity: Minor
                  Found in Application/Reporting/CheckList/Service.php - About 1 hr to fix

                    Method updateListObjectElementList has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            IFormInterface $Stage = null,
                            $Id = null,
                            $Data = null,
                            $HasData = null,
                            $objectList = null,
                    Severity: Major
                    Found in Application/Reporting/CheckList/Service.php - About 1 hr to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if ($tblObjectType->getIdentifier() === 'PERSON') {
                                                          $tblPerson = Person::useService()->getPersonById($objectId);
                                                          if ($tblPerson) {
                                                              $tblObject = $tblPerson;
                                                              $name = $tblPerson->getLastFirstName();
                      Severity: Major
                      Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ($tblProspect) {
                                                            $tblProspectReservation = $tblProspect->getTblProspectReservation();
                                                            if ($tblProspectReservation) {
                                                                if ($filterYear) {
                                                                    $year = trim($tblProspectReservation->getReservationYear());
                        Severity: Major
                        Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                                  if ($tblListObjectElementList->getServiceTblObject()) {
                                                                      if (!isset($Data[$tblListObjectElementList->getTblObjectType()->getId()]
                                                                          [$tblListObjectElementList->getServiceTblObject()->getId()]
                                                                          [$tblListObjectElementList->getTblListElementList()->getId()])
                                                                      ) {
                          Severity: Major
                          Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if ($tblProspectReservation) {
                                                        $filterYear = trim($tblProspectReservation->getReservationYear());
                                                    }
                            Severity: Major
                            Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                              if ($tblObject) {
                                                                  $tblListObjectElementList = $this->getListObjectElementListByListAndObjectTypeAndListElementListAndObject(
                                                                      $tblList, $tblObjectType, $tblObject
                                                                  );
                                                                  if ($tblListObjectElementList) {
                              Severity: Major
                              Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ($tblProspectReservation) {
                                                            $filterLevel = trim($tblProspectReservation->getReservationDivision());
                                                        }
                                Severity: Major
                                Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                  Function updateListElementList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function updateListElementList(IFormInterface $Stage = null, TblList $tblList, TblListElementList $tblListElementList, $ElementName)
                                      {
                                  
                                          /**
                                           * Skip to Frontend
                                  Severity: Minor
                                  Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if (!empty($objects)) {
                                                                  foreach ($objects as $objectId => $value) {
                                                                      if ($tblObjectType->getIdentifier() === 'PERSON') {
                                                                          $tblPerson = Person::useService()->getPersonById($objectId);
                                                                          $prospectGroup = Group::useService()->getGroupByMetaTable('PROSPECT');
                                  Severity: Major
                                  Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                    Function addElementToList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function addElementToList(IFormInterface $Stage = null, $Id, $Element)
                                        {
                                    
                                            /**
                                             * Skip to Frontend
                                    Severity: Minor
                                    Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Consider simplifying this complex logical expression.
                                    Open

                                                                            if ($filterYear && $filterLevel && $filterSchoolOption) {
                                                                                if ($hasYear && $hasLevel && $hasSchoolOption) {
                                                                                    $resultList[$tblObjectType->getId()][$tblPerson->getId()]
                                                                                        = $tblPerson->getLastFirstName();
                                                                                }
                                    Severity: Major
                                    Found in Application/Reporting/CheckList/Service.php - About 40 mins to fix

                                      Method filterObjectList has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public function filterObjectList($objectList, $filterYear, $filterLevel, $filterSchoolOption1, $filterSchoolOption2)
                                      Severity: Minor
                                      Found in Application/Reporting/CheckList/Service.php - About 35 mins to fix

                                        Method createCheckListExcel has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                TblList $tblList,
                                                $YearPersonId = null,
                                                $LevelPersonId = null,
                                                $SchoolOption1Id = null,
                                                $SchoolOption2Id = null
                                        Severity: Minor
                                        Found in Application/Reporting/CheckList/Service.php - About 35 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return $Stage;
                                          Severity: Major
                                          Found in Application/Reporting/CheckList/Service.php - About 30 mins to fix

                                            Function updateList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function updateList(IFormInterface $Stage = null, $Id, $List)
                                                {
                                            
                                                    /**
                                                     * Skip to Frontend
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php - About 25 mins to fix

                                            Cognitive Complexity

                                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                            A method's cognitive complexity is based on a few simple rules:

                                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                            • Code is considered more complex for each "break in the linear flow of the code"
                                            • Code is considered more complex when "flow breaking structures are nested"

                                            Further reading

                                            Function getObjectType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function getObjectType(IFormInterface $Stage = null, $ListId = null, $ObjectTypeSelect = null)
                                                {
                                            
                                                    /**
                                                     * Skip to Frontend
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php - About 25 mins to fix

                                            Cognitive Complexity

                                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                            A method's cognitive complexity is based on a few simple rules:

                                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                            • Code is considered more complex for each "break in the linear flow of the code"
                                            • Code is considered more complex when "flow breaking structures are nested"

                                            Further reading

                                            Function sortObjectList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function sortObjectList($objectList)
                                                {
                                            
                                                    if (!empty( $objectList )) {
                                                        foreach ($objectList as $objectTypeId => $objects) {
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php - About 25 mins to fix

                                            Cognitive Complexity

                                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                            A method's cognitive complexity is based on a few simple rules:

                                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                            • Code is considered more complex for each "break in the linear flow of the code"
                                            • Code is considered more complex when "flow breaking structures are nested"

                                            Further reading

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

                                                                                                            if ($tblToPhoneList) {
                                                                                                                foreach ($tblToPhoneList as $tblToPhone) {
                                                                                                                    if (( $tblPhone = $tblToPhone->getTblPhone() )) {
                                                                                                                        if (!isset($Item['PhoneGuardian'][$tblPersonGuardian->getId()])) {
                                                                                                                            $Item['PhoneGuardian'][$tblPersonGuardian->getId()] =
                                            Severity: Major
                                            Found in Application/Reporting/CheckList/Service.php and 1 other location - About 4 hrs to fix
                                            Application/Reporting/Custom/Chemnitz/Person/Service.php on lines 739..755

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

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

                                                                                            if ($tblProspectReservation) {
                                                                                                $level = $tblProspectReservation->getReservationDivision();
                                                                                                $year = $tblProspectReservation->getReservationYear();
                                                                                                $optionA = $tblProspectReservation->getServiceTblTypeOptionA();
                                                                                                $optionB = $tblProspectReservation->getServiceTblTypeOptionB();
                                            Severity: Major
                                            Found in Application/Reporting/CheckList/Service.php and 2 other locations - About 1 hr to fix
                                            Application/People/Search/Group/Frontend.php on lines 122..134
                                            Application/Reporting/CheckList/Frontend.php on lines 1498..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 103.

                                            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 ($YearPersonId !== null) {
                                                            $yearPerson = Person::useService()->getPersonById($YearPersonId);
                                                            if ($yearPerson) {
                                                                $hasFilter = true;
                                                                $tblProspect = Prospect::useService()->getProspectByPerson($yearPerson);
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php and 1 other location - About 55 mins to fix
                                            Application/Reporting/CheckList/Service.php on lines 883..895

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

                                            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 ($tblListObjectElementListByList) {
                                                            foreach ($tblListObjectElementListByList as $tblListObjectElementList) {
                                                                if ($tblListObjectElementList->getServiceTblObject()) {
                                                                    if (!isset($Data[$tblListObjectElementList->getTblObjectType()->getId()]
                                                                        [$tblListObjectElementList->getServiceTblObject()->getId()]
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php and 1 other location - About 55 mins to fix
                                            Application/Reporting/CheckList/Service.php on lines 714..731

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

                                            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 ($listObjectElementListList) {
                                                                                foreach ($listObjectElementListList as $tblListObjectElementList) {
                                                                                    if ($tblListObjectElementList->getServiceTblObject()) {
                                                                                        if (!isset($Data[$tblListObjectElementList->getTblObjectType()->getId()]
                                                                                            [$tblListObjectElementList->getServiceTblObject()->getId()]
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php and 1 other location - About 55 mins to fix
                                            Application/Reporting/CheckList/Service.php on lines 678..695

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

                                            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 ($LevelPersonId !== null) {
                                                            $levelPerson = Person::useService()->getPersonById($LevelPersonId);
                                                            if ($levelPerson) {
                                                                $hasFilter = true;
                                                                $tblProspect = Prospect::useService()->getProspectByPerson($levelPerson);
                                            Severity: Minor
                                            Found in Application/Reporting/CheckList/Service.php and 1 other location - About 55 mins to fix
                                            Application/Reporting/CheckList/Service.php on lines 870..882

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

                                            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

                                            There are no issues that match your filters.

                                            Category
                                            Status