piotrpolak/pepiscms

View on GitHub

Showing 482 of 487 total issues

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

    public function update($user_id, $display_name, $user_login = false, $group_ids = false, $password = false, $is_root = null, $data = array())
Severity: Major
Found in pepiscms/application/models/User_model.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 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

        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

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

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

                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

                  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 display_breadcrumb has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function display_breadcrumb($breadcrumb_array, $icon = false)
                      {
                          $count = count($breadcrumb_array);
                  
                          $o = '';
                  Severity: Minor
                  Found in pepiscms/application/helpers/dialog_message_helper.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

                                              for ($i = 0; $i < 99; $i++) {
                                                  $keys[] = $i;
                                              }
                  Severity: Major
                  Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

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

                        public function __construct()
                        {
                            // Getting cache path from configuration
                            $path = $this->config->raw_item('cache_path');
                            $this->is_enabled = $this->config->raw_item('cache_object_is_enabled');
                    Severity: Minor
                    Found in pepiscms/application/libraries/Cachedobjectmanager.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 google_maps_locate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function google_maps_locate($address)
                        {
                            $url = 'http://maps.google.com/maps/api/geocode/json?address=' . urlencode($address) . '&components=country:PL&sensor=false';
                            $contents = file_get_contents($url);
                            if (!$contents) {
                    Severity: Minor
                    Found in pepiscms/application/helpers/google_maps_helper.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 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

                      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

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

                            private function getTranslatedValue(array $definition, $fieldKey, $suffix = '')
                            {
                        
                                $translatedValue = false;
                                if ($this->lang !== null) {
                        Severity: Minor
                        Found in pepiscms/application/classes/CrudFieldDefinitionBuilder.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