piotrpolak/pepiscms

View on GitHub

Showing 485 of 486 total issues

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

    public function cleanup($collection = '')
    {
        if ($this->is_enabled !== true) {
            return false;
        }
Severity: Minor
Found in pepiscms/application/libraries/Cachedobjectmanager.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 index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function index()
    {
        $enable_frontend = $this->config->item('cms_enable_frontend');
        $intranet = $this->config->item('cms_intranet');

Severity: Minor
Found in pepiscms/application/controllers/public/Sitemap.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 drawSimpleLineChart has a Cognitive Complexity of 10 (exceeds 5 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')
    {
        $id = $this->generateId('line_chart');

        $out = $this->includeJavaScripts();
Severity: Minor
Found in pepiscms/application/libraries/Google_chart_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 storeObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function storeObject($name, $object_to_write, $collection = '')
    {
        $hash = $this->computeHash($name);
        $file_path = $this->computePath($collection, $hash);

Severity: Minor
Found in pepiscms/application/libraries/Cachedobjectmanager.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 resolveModuleDirectory has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function resolveModuleDirectory($module_name, $web_path = false)
    {
        if (isset($this->module_directory_cache[$module_name][$web_path])) {
            // Some kind of runtime cache
            return $this->module_directory_cache[$module_name][$web_path];
Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Loader.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 export has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function export()
    {
        if (!$this->isExportable()) {
            show_404();
        }
Severity: Minor
Found in pepiscms/modules/crud/libraries/AdminCRUDController.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 revisionrestorefield has a Cognitive Complexity of 10 (exceeds 5 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

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

    private function generateFilePreview($field, $valueEscaped, $display_delete_file_link)
    {
        \CI_Controller::get_instance()->load->helper('number');
        $output_element = '';
        if ($valueEscaped) {

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 validateByEmail has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function validateByEmail($user_email, $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 validateByLogin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

        Method storeObject has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function storeObject($name, $object_to_write, $collection = '')
            {
                $hash = $this->computeHash($name);
                $file_path = $this->computePath($collection, $hash);
        
        
        Severity: Minor
        Found in pepiscms/application/libraries/Cachedobjectmanager.php - About 1 hr to fix

          Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  parent::__construct(false);
                  $this->benchmark->mark('module_admin_controller_start');
          
          
          Severity: Minor
          Found in pepiscms/application/classes/ModuleAdminController.php - About 1 hr to fix

            Method generateSecurityPolicy has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function generateSecurityPolicy($module_name, $module_name_singular, $policy_save_path)
                {
                    $method_default_access = array(
                        'index' => 'READ',
                        'edit' => 'WRITE',
            Severity: Minor
            Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 1 hr to fix

              Method show has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function show()
                  {
                      $module = $this->input->getParam('module');
                      $file_name = $this->input->getParam('file_name');
                      $is_system = $module == 'system';
              Severity: Minor
              Found in pepiscms/modules/translator/controllers/TranslatorAdmin.php - About 1 hr to fix

                Method cleanPagesCache has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function cleanPagesCache()
                    {
                        $return = array('size' => 0, 'count' => 0);
                
                        $cache_path = $this->config->item('cache_path');
                Severity: Minor
                Found in pepiscms/modules/pages/models/Page_model.php - About 1 hr to fix

                  Method setupDefaultConfig has 26 lines of code (exceeds 25 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 1 hr to fix

                    Method saveAllConfigurationVariables has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function saveAllConfigurationVariables($data)
                        {
                            $known_config_data = (array)$this->getAllConfigurationVariables();
                    
                            $data = array_merge($known_config_data, $data);
                    Severity: Minor
                    Found in pepiscms/application/models/Siteconfig_model.php - About 1 hr to fix

                      Method update has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function update($module_name, $is_displayed_in_menu = false, $is_displayed_in_utilities = true, $parent_module_id = false)
                          {
                              // Reading module info
                              $module_info = $this->getInfoByName($module_name);
                      
                      
                      Severity: Minor
                      Found in pepiscms/application/models/Module_model.php - About 1 hr to fix

                        Method resolveComponent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function resolveComponent($componentId)
                            {
                                /**
                                 * @var $registeredComponents \PiotrPolak\PepisCMS\Formbuilder\Component\ComponentInterface[]
                                 */
                        Severity: Minor
                        Found in pepiscms/application/classes/DefaultFormRenderer.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language