piotrpolak/pepiscms

View on GitHub

Showing 481 of 486 total issues

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 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 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 _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 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 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 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 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 $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 $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 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 '';
                      Severity: Major
                      Found in pepiscms/modules/logs/libraries/LogsRowFormattingUtility.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $content;
                        Severity: Major
                        Found in pepiscms/modules/logs/controllers/LogsAdmin.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 false;
                            Severity: Major
                            Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language