GemsTracker/gemstracker-library

View on GitHub

Showing 1,617 of 4,272 total issues

File MenuAbstract.php has 628 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 *
 * @package    Gems
Severity: Major
Found in classes/Gems/Menu/MenuAbstract.php - About 1 day to fix

    File SubMenuItem.php has 625 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      File Form.php has 623 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Helper for OpenRosa forms
       *
       * It supports a subset of OpenRosa forms and provides a bridge between GemsTracker
      Severity: Major
      Found in classes/OpenRosa/Tracker/Source/Form.php - About 1 day to fix

        File UpgradeCompatibilitySnippet.php has 601 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          Function addRowWithCount has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
          Open

              public function addRowWithCount($row, $writer, $rowNumber)
              {
                  $exportRow   = $this->filterRow($row);
                  $labeledCols = $this->getLabeledColumns();
                  $exportRow   = array_replace(array_flip($labeledCols), $exportRow);
          Severity: Minor
          Found in classes/Gems/Export/StreamingStataExport.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

          Function render has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render($content)
              {
                  $useBootstrap = \MUtil_Bootstrap::enabled();
          
                  if ((null === ($element = $this->getElement())) ||
          Severity: Minor
          Found in classes/Gems/Form/Decorator/Tabs.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 TrackEngineAbstract.php has 590 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Method addRespondentPage has 248 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function addRespondentPage($label)
                {
                    $orgId = $this->currentUser->getCurrentOrganizationId();
            
                    $params = array(\MUtil_Model::REQUEST_ID1  => 'gr2o_patient_nr', \MUtil_Model::REQUEST_ID2 => 'gr2o_id_organization');
            Severity: Major
            Found in classes/Gems/Menu.php - About 1 day to fix

              File StepEngineAbstract.php has 573 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                File BrowseEditAction.php has 564 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Gems_Tracker_RespondentTrack has 65 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Gems_Tracker_RespondentTrack extends \Gems_Registry_TargetAbstract
                  {
                      use DbTranslateUtilTrait;
                      
                      /**
                  Severity: Major
                  Found in classes/Gems/Tracker/RespondentTrack.php - About 1 day to fix

                    File Tracker.php has 551 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      File TrafficLightTokenSnippet.php has 544 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

                        Function routeShutdown has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function routeShutdown(\Zend_Controller_Request_Abstract $request)
                            {
                                $loader = $this->getLoader();
                        
                                // Load the menu. As building the menu can depend on all resources and the request, we do it here.
                        Severity: Minor
                        Found in classes/GemsEscort.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

                        Function resetpasswordAction has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function resetpasswordAction()
                            {
                                $errors  = array();
                                $form    = $this->createResetRequestForm();
                                $request = $this->getRequest();
                        Severity: Minor
                        Found in classes/Gems/Default/IndexAction.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 RespondentNewAction.php has 516 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

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

                          File StreamingStataExport.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          namespace Gems\Export;
                          
                          use XMLWriter;
                          Severity: Major
                          Found in classes/Gems/Export/StreamingStataExport.php - About 1 day to fix

                            Function applyToModel has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function applyToModel(\MUtil_Model_ModelAbstract $model)
                                {
                                    $map    = $this->_getMap();
                                    $oldfld = null;
                                    $parent = null;
                            Severity: Minor
                            Found in classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.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

                            Function _format has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function _format($name, $result, $model)
                                {
                                    static $view = null;
                            
                                    if (!isset($this->_options[$name])) {
                            Severity: Minor
                            Found in classes/Gems/FormattedData.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

                            Function execute has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function execute($row = null,
                                        $noToken = \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR,
                                        $tokenCompletion = \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR)
                                {
                                    // \MUtil_Echo::track($row);
                            Severity: Minor
                            Found in classes/Gems/Task/Import/SaveAnswerTask.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

                            Severity
                            Category
                            Status
                            Source
                            Language