piotrpolak/pepiscms

View on GitHub

Showing 482 of 487 total issues

Method buildFileStructure has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildFileStructure($base_path)
    {
        $mainpage_module_path = $base_path . 'modules/mainpage/';

        $files_template_path = realpath(dirname(realpath(__FILE__)) . '/../../resources/files_template/') . '/';
Severity: Minor
Found in pepiscms/application/libraries/Installer_helper.php - About 1 hr to fix

    Method getAdvancedFeed has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getAdvancedFeed($columns, $offset, $rowcount, $order_by_column, $order, $filters, $extra_param)
        {
            if (!$columns || $columns == '*') { // TODO Check if $columns == '*' is ok
                $columns = $this->getTable() . '.*';
            }
    Severity: Minor
    Found in pepiscms/application/models/Generic_model.php - About 1 hr to fix

      Method revision has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method getManyToManyRelationshipsRelatedToTable has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getManyToManyRelationshipsRelatedToTable($table)
            {
                $related_foreign_keys = $this->getForeignKeysRelatedToTable($table);
        
                $many_to_many_fks = array();
        Severity: Minor
        Found in pepiscms/modules/crud/libraries/TableUtility.php - About 1 hr to fix

          Method install has 32 lines of code (exceeds 25 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

            Method configure has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function configure()
                {
                    $module = $this->input->getParam('module');
            
                    $render_as_module = $this->input->getParam('render_as_module');
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Module.php - About 1 hr to fix

              Method niceuri has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function niceuri($name)
                  {
                      //form_prep
                      if (strlen($name) == 0) {
                          return '';
              Severity: Minor
              Found in pepiscms/application/helpers/PEPISCMS_string_helper.php - About 1 hr to fix

                Method drawSimplePieChart has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function drawSimplePieChart($data_feed, $title = '', $width = 1200, $height = 200)
                    {
                        $id = $this->generateId('pie_chart');
                
                        $out = $this->includeJavaScripts();
                Severity: Minor
                Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

                  Function writeDatabase has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function writeDatabase($data)
                      {
                          $db = $this->load->database($this->getDefaultDatabaseConfig($data), true);
                  
                          $error = false;
                  Severity: Minor
                  Found in pepiscms/application/libraries/Installer_helper.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 addColumnByDefinition has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function addColumnByDefinition($column, $key = false)
                      {
                          $defaults = $this->getFieldDefaults();
                          if (!isset($column['filter_condition']) && isset($column['filter_type'])) {
                              $defaults['filter_condition'] = $this->getDefaultFilterConditionByFilterType($column['filter_type']);
                  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 getAllAvailableEntities has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getAllAvailableEntities()
                      {
                          $all_entities = array();
                  
                          $entities = array();
                  Severity: Minor
                  Found in pepiscms/application/libraries/SecurityPolicy.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 applyWhere has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function applyWhere($db, $where_conditions)
                      {
                          if ($where_conditions) {
                              foreach ($where_conditions as $key => $condition) {
                                  if (!$key || is_numeric($key)) {
                  Severity: Minor
                  Found in pepiscms/application/models/Generic_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 buildFileStructure has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function buildFileStructure($base_path)
                      {
                          $mainpage_module_path = $base_path . 'modules/mainpage/';
                  
                          $files_template_path = realpath(dirname(realpath(__FILE__)) . '/../../resources/files_template/') . '/';
                  Severity: Minor
                  Found in pepiscms/application/libraries/Installer_helper.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 getTwig has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function getTwig()
                      {
                          if (!self::$twig_instance) {
                              $this->benchmark->mark('twig_initialization_start');
                              $loader = new Twig_Loader_Filesystem();
                  Severity: Minor
                  Found in pepiscms/application/libraries/Twig.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 error has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function error($message, $collection = 'SYSTEM', $resource_id = false, $notify = true)
                      {
                          if ($notify && self::$config->item('debug_maintainer_email_address')) {
                              $hash = md5($message . '' . $collection);
                              $path = INSTALLATIONPATH . 'application/cache/errors/';
                  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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function update($user_id, $display_name, $user_login = false, $group_ids = false, $password = false, $is_root = null, $data = array())
                      {
                          // Change user password if specified
                          if ($password) {
                              $this->changePasswordByUserId($user_id, $password);
                  Severity: Minor
                  Found in pepiscms/application/models/User_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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function render()
                      {
                          $this->benchmark->mark('widget_'.$this->module_name.'_'.$this->module_name.'_render_start');
                          $controller_path = $this->modulepathresolver->getWidgetControllerPath($this->module_name);
                  
                  
                  Severity: Minor
                  Found in pepiscms/application/classes/WidgetRenderer.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

                  Method drawSimpleLineChart has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function drawSimpleLineChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number", $colors = array(), $type = 'number')
                  Severity: Major
                  Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

                    Function index has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function index()
                        {
                            if (ENVIRONMENT !== 'development') {
                                show_error('Upgradedb utility is only available in development environment. <a href="' . admin_url() . '">Go back to admin panel</a>');
                    
                    
                    Severity: Minor
                    Found in pepiscms/application/controllers/admin/Upgradedb.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 display has a Cognitive Complexity of 11 (exceeds 5 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

                    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