piotrpolak/pepiscms

View on GitHub

Showing 485 of 486 total issues

Function resolveModuleDirectory has a Cognitive Complexity of 7 (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 35 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 fast_cache_get_cache_for_uri has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function fast_cache_get_cache_for_uri($uri)
{
    $uri_hash = md5($uri);
    $filepath = INSTALLATIONPATH . 'application/cache/pages/' . $uri_hash . '.html';

Severity: Minor
Found in pepiscms/application/tools/fast_cache_filesystem.php - About 35 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 _write_cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _write_cache($output)
    {
        // Failsafe variable
        $no_fastcacheable = true;

Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Output.php - About 35 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 module_make has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function module_make()
    {
        $this->assign('title', $this->lang->line('development_make_a_new_module'));
        $this->assign('success', false);

Severity: Minor
Found in pepiscms/modules/development/controllers/DevelopmentAdmin.php - About 35 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 _overwrite_value_from_database has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function _overwrite_value_from_database($item)
    {
        if (class_exists('CI_Controller')) {
            if (!isset(CI_Controller::get_instance()->db)) {
                return;
Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Config.php - About 35 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 regenerateSetAcceptedFieldsForExistingModel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function regenerateSetAcceptedFieldsForExistingModel($file_model_path, $data)
    {
        // Replace acceptable fields
        $model_file_contents_exploded = file($file_model_path, FILE_IGNORE_NEW_LINES);
        if (count($model_file_contents_exploded) > 0) {
Severity: Minor
Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 35 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_cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _display_cache(&$CFG, &$URI)
    {
        // Failsafe variable
        $no_fastcacheable = true;

Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Output.php - About 35 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 index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function index()
    {
        $this->load->library('ModuleRunner');
        $modules = ModuleRunner::getAvailableModules();

Severity: Minor
Found in pepiscms/modules/translator/controllers/TranslatorAdmin.php - About 35 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 edit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit($display_view = true)
    {
        $id = $this->input->getParam('id');
        $sameuser = $this->auth->getUserId() == $id;

Severity: Minor
Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 35 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 getInputType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInputType($type, $field_name)
    {
        if ($type == 'smallint') {
            return FormBuilder::CHECKBOX;
        } elseif (self::isDbTypeNumeric($type)) {
Severity: Minor
Found in pepiscms/modules/crud/libraries/TableUtility.php - About 35 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 too many return statements within this method.
Open

            return $obj->value;
Severity: Major
Found in pepiscms/application/models/Siteconfig_model.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $this->getSessionVariable('is_user_password_expired');
    Severity: Major
    Found in pepiscms/application/libraries/Auth.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return false;
      Severity: Major
      Found in pepiscms/application/libraries/SecurityManager.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return $dump;
        Severity: Major
        Found in pepiscms/application/helpers/mysqldump_helper.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return true;
          Severity: Major
          Found in pepiscms/application/libraries/PEPISCMS_Upload.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $success;
            Severity: Major
            Found in pepiscms/application/libraries/PEPISCMS_Upload.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return false;
              Severity: Major
              Found in pepiscms/application/helpers/mysqldump_helper.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return false;
                Severity: Major
                Found in pepiscms/application/controllers/admin/Changepassword.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return false;
                  Severity: Major
                  Found in pepiscms/application/libraries/PEPISCMS_Upload.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return $this->_in_progress = false;
                    Severity: Major
                    Found in pepiscms/application/core/PEPISCMS_Hooks.php - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language