bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Method _like has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL)
Severity: Minor
Found in system/database/DB_query_builder.php - About 45 mins to fix

    Function _limit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _limit($sql)
        {
            $limit = $this->qb_offset + $this->qb_limit;
    
            // As of SQL Server 2005 (9.0.*) ROW_NUMBER() is supported,
    Severity: Minor
    Found in system/database/drivers/mssql/mssql_driver.php - About 45 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 plural has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        function plural($str)
        {
            $result = strval($str);
    
            if ( ! word_is_countable($result))
    Severity: Minor
    Found in system/helpers/inflector_helper.php - About 45 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 _compile_order_by has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _compile_order_by()
        {
            if (empty($this->qb_orderby))
            {
                return '';
    Severity: Minor
    Found in system/database/DB_query_builder.php - About 45 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 _build_dsn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _build_dsn()
        {
            $this->dsn === '' OR $this->dsn = '';
    
            if (strpos($this->hostname, '/') !== FALSE)
    Severity: Minor
    Found in system/database/drivers/postgre/postgre_driver.php - About 45 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            $this->config =& get_config();
    
            // Set the base_url automatically if none was provided
    Severity: Minor
    Found in system/core/Config.php - About 45 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 deeply nested control flow statements.
    Open

                                for ($j = 0; $j < 8; $j++)
                                {
                                    $ip[$j] = intval($ip[$j], 16);
                                }
    Severity: Major
    Found in system/core/Input.php - About 45 mins to fix

      Function is_really_writable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function is_really_writable($file)
          {
              // If we're on a UNIX-like server, just is_writable()
              if (DIRECTORY_SEPARATOR === '/')
              {
      Severity: Minor
      Found in system/core/Common.php - About 45 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 _error_handler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function _error_handler($severity, $message, $filepath, $line)
          {
              $is_error = (((E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR) & $severity) === $severity);
      
              // When an error occurred, set the status header to '500 Internal Server Error'
      Severity: Minor
      Found in system/core/Common.php - About 45 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 html_escape has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function html_escape($var, $double_encode = TRUE)
          {
              if (empty($var))
              {
                  return $var;
      Severity: Minor
      Found in system/core/Common.php - About 45 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

      Method hash_pbkdf2 has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function hash_pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = FALSE)
      Severity: Minor
      Found in system/core/compat/hash.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($proxy_ips[$i] === $this->ip_address)
                                {
                                    $this->ip_address = $spoof;
                                    break;
                                }
        Severity: Major
        Found in system/core/Input.php - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if (preg_match($valid_dsns['tns'], $this->hostname))
                  {
                      $this->dsn = $this->hostname;
                      return;
                  }
          Severity: Major
          Found in system/database/drivers/oci8/oci8_driver.php - About 40 mins to fix

            Method hkdf has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function hkdf($key, $digest = 'sha512', $salt = NULL, $length = NULL, $info = '')
            Severity: Minor
            Found in system/libraries/Encryption.php - About 35 mins to fix

              Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct($path, $server, $port = 80, $proxy = FALSE, $proxy_port = 8080)
              Severity: Minor
              Found in system/libraries/Xmlrpc.php - About 35 mins to fix

                Method _wh has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = NULL)
                Severity: Minor
                Found in system/database/DB_query_builder.php - About 35 mins to fix

                  Method load has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
                  Severity: Minor
                  Found in system/core/Lang.php - About 35 mins to fix

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

                        protected function _set_browser()
                        {
                            if (is_array($this->browsers) && count($this->browsers) > 0)
                            {
                                foreach ($this->browsers as $key => $val)
                    Severity: Minor
                    Found in system/libraries/User_agent.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 set_filename has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function set_filename($path, $filename)
                        {
                            if ($this->encrypt_name === TRUE)
                            {
                                $filename = md5(uniqid(mt_rand())).$this->file_ext;
                    Severity: Minor
                    Found in system/libraries/Upload.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 _load_agent_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _load_agent_file()
                        {
                            if (($found = file_exists(APPPATH.'config/user_agents.php')))
                            {
                                include(APPPATH.'config/user_agents.php');
                    Severity: Minor
                    Found in system/libraries/User_agent.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

                    Severity
                    Category
                    Status
                    Source
                    Language