piotrpolak/pepiscms

View on GitHub

Showing 482 of 487 total issues

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

    public function send($to, $from, $from_name, $subject, $message,
                         $html = false, $attachments = array(), $reply_to = false, $reply_to_name = false)
Severity: Major
Found in pepiscms/application/libraries/EmailSender.php - About 1 hr to fix

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

        public function sendSystemTemplate($to, $from, $from_name, $subject, $email_template_name,
                                           $data = array(), $html = false, $language = false, $attachments = array())
    Severity: Major
    Found in pepiscms/application/libraries/EmailSender.php - About 1 hr to fix

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

          public function makeUserSpaceModule($module_database_table_name,
                                              $module_name,
                                              $auto_install = true,
                                              $parse_database_schema = true,
                                              $database_group = false,
      Severity: Major
      Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 1 hr to fix

        Method log has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function log($message, $level = self::MESSAGE_LEVEL_INFO, $collection = 'SYSTEM', $resource_id = false, $user_id = false, $timestamp = false)
            {
                $CI = &get_instance();
                $CI->load->helper('date');
        
        
        Severity: Minor
        Found in pepiscms/application/libraries/Logger.php - About 1 hr to fix

          Function init has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.init = function () {
                  if (translation_map.label_unsaved_changes)
                      label_unsaved_changes = translation_map.label_unsaved_changes;
          
          
          
          Severity: Minor
          Found in pepiscms/js/pageeditor.js - About 1 hr to fix

            Function navFilesTree has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                navFilesTree: function (el, trigger) {
            
                    /* if item has .active, leave it open */
                    $('li', el).each(function () {
                        if ($('ul a', this).hasClass('active')) {
            Severity: Minor
            Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

              Method validateByUserId has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function validateByUserId($user_id, $password)
                  {
                      // Attempt to select user password metadata
                      $row = $this->db->select('user_id, hashing_salt, hashing_algorithm, hashing_iterations')
                          ->from($this->getTable())
              Severity: Minor
              Found in pepiscms/application/models/User_model.php - About 1 hr to fix

                Method ip_info has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function ip_info($ip)
                    {
                        if (!filter_var($ip, FILTER_VALIDATE_IP)) {
                            throw new InvalidArgumentException('IP is not valid');
                        }
                Severity: Minor
                Found in pepiscms/application/helpers/ip_helper.php - About 1 hr to fix

                  Method getfile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getfile()
                      {
                          $max = $this->uri->total_segments() + 1;
                          $current_path = '';
                          for ($i = 4; $i < $max; $i++) {
                  Severity: Minor
                  Found in pepiscms/application/controllers/admin/Ajaxfilemanager.php - About 1 hr to fix

                    Method mylogin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function mylogin()
                        {
                            $this->load->library('DataGrid');
                            $this->load->library('LogsRowFormattingUtility');
                            $this->datagrid->setTable($this->config->item('database_table_logs'), array(
                    Severity: Minor
                    Found in pepiscms/modules/logs/controllers/LogsAdmin.php - About 1 hr to fix

                      Method display has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function display($view = false, $display_header = true, $display_footer = true, $return = false)
                          {
                              $return_html = true;
                              if ($this->already_displayed && !$return) {
                                  return false;
                      Severity: Minor
                      Found in pepiscms/application/classes/AdminController.php - About 1 hr to fix

                        Method revisionrestorefield has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function revisionrestorefield()
                            {
                                $id = $this->input->getParam('id');
                                $revision_id = $this->input->getParam('revision_id');
                                $field = $this->input->getParam('field');
                        Severity: Minor
                        Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 1 hr to fix

                          Method generate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function generate()
                              {
                                  $instance_map = array('loader' => 'load');
                          
                                  $core_components = $this->fetchCoreComponents(array(
                          Severity: Minor
                          Found in pepiscms/modules/development/libraries/HeadersGenerator.php - About 1 hr to fix

                            Method orderFieldsByImportance has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function orderFieldsByImportance($definition)
                                {
                                    $order = array(
                                        FormBuilder::TEXTFIELD,
                                        FormBuilder::PASSWORD,
                            Severity: Minor
                            Found in pepiscms/modules/crud/libraries/TableUtility.php - About 1 hr to fix

                              Method edit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function edit()
                                  {
                                      $url_suffix = $this->config->item('url_suffix');
                                      $site_language = $this->getAttribute('site_language');
                                      $view = $this->input->getParam('view');
                              Severity: Minor
                              Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 1 hr to fix

                                Function generateLink has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private static function generateLink($base_url, $page = 1, $order_by = false, $order = false, $filters = false)
                                    {
                                        $url = $base_url;
                                        if ($page > 1) {
                                            $url .= '/page-' . $page;
                                Severity: Minor
                                Found in pepiscms/application/libraries/DataGrid.php - About 1 hr 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 parseCommandFeedByExplode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    protected function parseCommandFeedByExplode($contents, $fields_that_can_contain_spaces = array())
                                    {
                                        // Line counter, -1 meaning reading headers
                                        $line_counter = -1;
                                        // The array containing parsed output
                                Severity: Minor
                                Found in pepiscms/application/models/Ssh_model.php - About 1 hr 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 errorHandlerWithLogging has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static function errorHandlerWithLogging($errno, $errstr, $errfile, $errline)
                                    {
                                        if ($errno == E_USER_ERROR) {
                                            if (self::$config->item('debug_log_php_error')) {
                                                Logger::error($errstr . '; line: ' . $errline . '; file: ' . $errfile, 'PHP');
                                Severity: Minor
                                Found in pepiscms/application/libraries/Logger.php - About 1 hr 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 navFilesTree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    navFilesTree: function (el, trigger) {
                                
                                        /* if item has .active, leave it open */
                                        $('li', el).each(function () {
                                            if ($('ul a', this).hasClass('active')) {
                                Severity: Minor
                                Found in pepiscms/js/jquery.frontend.js - About 1 hr 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 install has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function install($module_name, $is_displayed_in_menu = false, $is_displayed_in_utilities = true, $parent_module_id = null)
                                    {
                                        if ($this->isInstalled($module_name)) {
                                            return false;
                                        }
                                Severity: Minor
                                Found in pepiscms/application/models/Module_model.php - About 1 hr 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