bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(CI_Config $config)
    {
        $this->config = $config;

        // If it's a CLI request, ignore the configuration
Severity: Minor
Found in system/core/URI.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 entity_decode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function entity_decode($str, $charset = NULL)
    {
        if (strpos($str, '&') === FALSE)
        {
            return $str;
Severity: Minor
Found in system/core/Security.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 $this->object->{$method_parts[1]}($m);
Severity: Major
Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $this->_success;
    Severity: Major
    Found in system/libraries/Session/drivers/Session_database_driver.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return new XML_RPC_Values(array($result->value()), 'array');
      Severity: Major
      Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return;
        Severity: Major
        Found in system/libraries/Upload.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $this->_failure;
          Severity: Major
          Found in system/libraries/Session/drivers/Session_database_driver.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $session_data;
            Severity: Major
            Found in system/libraries/Session/drivers/Session_files_driver.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return FALSE;
              Severity: Major
              Found in system/libraries/Image_lib.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $current_version;
                Severity: Major
                Found in system/libraries/Migration.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return ' checked="checked"';
                  Severity: Major
                  Found in system/libraries/Form_validation.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return FALSE;
                    Severity: Major
                    Found in system/libraries/Image_lib.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return TRUE;
                      Severity: Major
                      Found in system/libraries/Image_lib.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return FALSE;
                        Severity: Major
                        Found in system/libraries/Email.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return TRUE;
                          Severity: Major
                          Found in system/libraries/Upload.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return $this->_success;
                            Severity: Major
                            Found in system/libraries/Session/drivers/Session_memcached_driver.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return FALSE;
                              Severity: Major
                              Found in system/libraries/Session/drivers/Session_database_driver.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return ' selected="selected"';
                                Severity: Major
                                Found in system/libraries/Form_validation.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return (filter_var('http://'.$str, FILTER_VALIDATE_URL) !== FALSE);
                                  Severity: Major
                                  Found in system/libraries/Form_validation.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return $this->multicall_error($result);
                                    Severity: Major
                                    Found in system/libraries/Xmlrpcs.php - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language