piotrpolak/pepiscms

View on GitHub

Showing 482 of 487 total issues

Method getAdvancedFeed has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function getAdvancedFeed($columns, $offset, $rowcount, $order_by_column, $order, $filters, $extra_param)
Severity: Major
Found in pepiscms/application/models/Array_model.php - About 50 mins to fix

    Method getAdvancedFeed has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getAdvancedFeed($columns, $start, $rowcount, $orderby_column, $order, $filters, $extra_param);
    Severity: Major
    Found in pepiscms/application/classes/AdvancedDataFeedableInterface.php - About 50 mins to fix

      Method mysqldump has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function mysqldump($db_host, $database, $db_user, $db_password, $tables = false, $dump_to_filename = false, $dump_structure = true)
      Severity: Major
      Found in pepiscms/application/helpers/mysqldump_helper.php - About 50 mins to fix

        Method log has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function log($message, $level = self::MESSAGE_LEVEL_INFO, $collection = 'SYSTEM', $resource_id = false, $user_id = false, $timestamp = false)
        Severity: Minor
        Found in pepiscms/application/libraries/Logger.php - About 45 mins to fix

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

              public function getMenuFlat($parent_item_id = 0, $language_code = 'en', $dont_enter_item_id = false, $separator = false, &$menu = array(), $return = true, $prefix = '')
              {
                  if (!$language_code) {
                      $language_code = 'en';
                  }
          Severity: Minor
          Found in pepiscms/application/models/Menu_model.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

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

              public function valid_timestamp($str)
              {
                  if (strlen($str) == 0) {
                      return true;
                  }
          Severity: Minor
          Found in pepiscms/application/libraries/PEPISCMS_Form_validation.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

          Method getAssocPairs has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function getAssocPairs($key_column_name, $value_column_name, $table = false, $imitial_array = false,
                                            $possible_keys = false, $where_conditions = false)
          Severity: Minor
          Found in pepiscms/application/models/Generic_model.php - About 45 mins to fix

            Method enableJournaling has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function enableJournaling($journaling_table = false, $include_fields = array(), $exclude_fields = array(),
                                                 $tag = null, $serialization_method = null, $unserialization_method = null)
            Severity: Minor
            Found in pepiscms/application/models/Generic_model.php - About 45 mins to fix

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

                  public function setupDefaultConfig()
                  {
                      $this->load->config('editor');
                      $descriptor['editor_css_file'] = $this->config->item('editor_css_file');
                      $descriptor['editor_css_body_id'] = $this->config->item('editor_css_body_id');
              Severity: Minor
              Found in pepiscms/application/libraries/RTFEditor.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

              Method move has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function move($id, $direction, $table = false, $constraint_field_name = false,
                                       $item_order_field_name = 'item_order', $id_field_name = 'id')
              Severity: Minor
              Found in pepiscms/application/models/Generic_model.php - About 45 mins to fix

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

                    public static function hasAccess($controller, $method = false, $module = false)
                    {
                        if (!$method) {
                            $method = 'index';
                        }
                Severity: Minor
                Found in pepiscms/application/libraries/SecurityManager.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

                Method copyFileSsh has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function copyFileSsh($host, $port, $login = false, $password = false, $local_file = false, $remote_file = false)
                Severity: Minor
                Found in pepiscms/application/models/Ssh_model.php - About 45 mins to fix

                  Method generateExcel has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function generateExcel($feed, $headers = false, $file_name = false, $send = true, $print_headers = true, $excel_type = Spreadsheet::EXCEL_XLS)
                  Severity: Minor
                  Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

                    Method move has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function move($id, $direction, $table = false, $constraint_field_name = false, $item_order_field_name = 'item_order', $id_field_name = 'id');
                    Severity: Minor
                    Found in pepiscms/application/classes/MoveableInterface.php - About 45 mins to fix

                      Method generateXML has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function generateXML($feed, $headers = false, $file_name = false, $send = true, $root_name = false, $item_name = false)
                      Severity: Minor
                      Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

                        Method generateCSV has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function generateCSV($feed, $headers = false, $file_name = false, $send = true, $separator = false, $print_headers = true)
                        Severity: Minor
                        Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (!$key) {
                                                              $key = $ki;
                                                          }
                          Severity: Major
                          Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

                            Method dashboard_box has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function dashboard_box($name, $url, $icon_path = false, $description = false, $is_popup = false, $target = false)
                            Severity: Minor
                            Found in pepiscms/application/helpers/dialog_message_helper.php - About 45 mins to fix

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

                                  private function renderInput($field, $value, &$object,
                                                               \PiotrPolak\PepisCMS\Formbuilder\Component\ComponentInterface $component, $readOnly)
                                  {
                                      $extra_css_classes = $this->computeExtraCssClasses($field);
                              
                              
                              Severity: Minor
                              Found in pepiscms/application/classes/DefaultFormRenderer.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

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

                                  private function buildSubmenuUrl($module, $item, $language_code)
                                  {
                                      if (!$module->name) {
                                          $submenu_url = admin_url() . $item[self::PROP_CONTROLLER] . '/';
                                      } elseif (isset($item[self::PROP_MODULE]) && $item[self::PROP_MODULE]) {
                              Severity: Minor
                              Found in pepiscms/application/libraries/MenuRendor.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

                              Severity
                              Category
                              Status
                              Source
                              Language