piotrpolak/pepiscms

View on GitHub

Showing 481 of 486 total issues

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

    private function generateFilterElement($value, $key)
    {
        $filters_element = '';
        foreach ($value as $v_key => $v_value) {
            if ($v_key == 'filter_type') {
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 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 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 $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 $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 $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 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 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 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 $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/core/PEPISCMS_Hooks.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return true;
                      Severity: Major
                      Found in pepiscms/application/core/PEPISCMS_Hooks.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

                          Avoid too many return statements within this method.
                          Open

                                          return false;
                          Severity: Major
                          Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.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