GemsTracker/gemstracker-library

View on GitHub

Showing 4,260 of 4,272 total issues

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

                switch ($row['type']) {
                    case '1':        //Dual scale
                        //Check scale header in attributes table
                        $row1 = $row;
                        $row1['sgq'] .= $row['sq_title'] . '#0';
Severity: Major
Found in classes/Gems/Tracker/Source/LimeSurvey4m00FieldMap.php and 1 other location - About 1 wk to fix
classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php on lines 243..372

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

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

                switch ($row['type']) {
                    case '1':        //Dual scale
                        //Check scale header in attributes table
                        $row1 = $row;
                        $row1['sgq'] .= $row['sq_title'] . '#0';
Severity: Major
Found in classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php and 1 other location - About 1 wk to fix
classes/Gems/Tracker/Source/LimeSurvey4m00FieldMap.php on lines 150..279

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

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

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

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

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

Refactorings

Further Reading

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

<?php

/**
 *
 * @package    Gems
Severity: Major
Found in classes/Gems/Default/AgendaProcedureAction.php and 1 other location - About 3 days to fix
classes/Gems/Default/AgendaActivityAction.php on lines 1..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 715.

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

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

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

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

Refactorings

Further Reading

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

<?php

/**
 *
 * @package    Gems
Severity: Major
Found in classes/Gems/Default/AgendaActivityAction.php and 1 other location - About 3 days to fix
classes/Gems/Default/AgendaProcedureAction.php on lines 1..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 715.

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

File GemsEscort.php has 1410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Project Application Core code
 *
Severity: Major
Found in classes/GemsEscort.php - About 3 days to fix

    File User.php has 1320 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     *
     * @package    Gems
    Severity: Major
    Found in classes/Gems/User/User.php - About 3 days to fix

      File Token.php has 1186 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       *
       * @package    Gems
      Severity: Major
      Found in classes/Gems/Tracker/Token.php - About 3 days to fix

        Gems_User_User has 118 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Gems_User_User extends \MUtil_Translate_TranslateableAbstract
        {
            /**
             *
             * @var TwoFactorAuthenticatorInterface
        Severity: Major
        Found in classes/Gems/User/User.php - About 2 days to fix

          File RespondentTrack.php has 928 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           *
           * @package    Gems
          Severity: Major
          Found in classes/Gems/Tracker/RespondentTrack.php - About 2 days to fix

            File LimeSurvey1m9Database.php has 868 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             *
             * @package    Gems
            Severity: Major
            Found in classes/Gems/Tracker/Source/LimeSurvey1m9Database.php - About 2 days to fix

              Gems_Tracker_Token has 105 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Gems_Tracker_Token extends \Gems_Registry_TargetAbstract
              {
                  use TranslateableTrait;
              
                  const COMPLETION_NOCHANGE = 0;
              Severity: Major
              Found in classes/Gems/Tracker/Token.php - About 2 days to fix

                File Agenda.php has 830 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 *
                 * @package    Gems
                Severity: Major
                Found in classes/Gems/Agenda.php - About 1 day to fix

                  Function getModel has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getModel()
                      {
                          if (empty($this->model)) {
                              try {
                                  $model = new \Gems_Model_JoinModel($this->getFormID(), $this->getTableName(), 'orf');
                  Severity: Minor
                  Found in classes/OpenRosa/Tracker/Source/Form.php - About 1 day 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

                      protected function createMenuLinks($includeLevel = 2, $parentLabel = true)
                      {
                          if ($currentItem  = $this->menu->getCurrent()) {
                              $links        = array();
                              $childItems   = $currentItem->getChildren();
                  Severity: Major
                  Found in classes/Gems/Default/DatabaseAction.php and 1 other location - About 1 day to fix
                  classes/Gems/Controller/ModelActionAbstract.php on lines 70..123

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

                  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

                      protected function createMenuLinks($includeLevel = 2, $parentLabel = true)
                      {
                          if ($currentItem  = $this->menu->getCurrent()) {
                              $links        = array();
                              $childItems   = $currentItem->getChildren();
                  Severity: Major
                  Found in classes/Gems/Controller/ModelActionAbstract.php and 1 other location - About 1 day to fix
                  classes/Gems/Default/DatabaseAction.php on lines 139..192

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

                  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

                  File ImportTrackSnippetAbstract.php has 767 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   *
                   * @package    Gems
                  Severity: Major
                  Found in classes/Gems/Tracker/Snippets/ImportTrackSnippetAbstract.php - About 1 day to fix

                    Function checkSurvey has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function checkSurvey($sourceSurveyId, $surveyId, $userId)
                        {
                            $messages = array();
                            $survey   = $this->tracker->getSurvey($surveyId);
                    
                    
                    Severity: Minor
                    Found in classes/Gems/Tracker/Source/LimeSurvey1m9Database.php - About 1 day 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 TrackAction.php has 737 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /**
                     *
                     * @package    Gems
                    Severity: Major
                    Found in classes/Gems/Default/TrackAction.php - About 1 day to fix

                      File ProjectSettings.php has 730 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       *
                       * @package    Gems
                      Severity: Major
                      Found in classes/Gems/Project/ProjectSettings.php - About 1 day to fix

                        File Menu.php has 726 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /**
                         * @package    Gems
                         * @subpackage Menu
                        Severity: Major
                        Found in classes/Gems/Menu.php - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language