bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

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

    public function do_multicall($call)
    {
        if ($call->kindOf() !== 'struct')
        {
            return $this->multicall_error('notstruct');
Severity: Minor
Found in system/libraries/Xmlrpcs.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 read_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function read_file($path, $archive_filepath = FALSE)
    {
        if (file_exists($path) && FALSE !== ($data = file_get_contents($path)))
        {
            if (is_string($archive_filepath))
Severity: Minor
Found in system/libraries/Zip.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 connect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function connect($config = array())
    {
        if (count($config) > 0)
        {
            $this->initialize($config);
Severity: Minor
Found in system/libraries/Ftp.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 from has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function from($from, $name = '', $return_path = NULL)
    {
        if (preg_match('/\<(.*)\>/', $from, $match))
        {
            $from = $match[1];
Severity: Minor
Found in system/libraries/Email.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 valid_url has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function valid_url($str)
    {
        if (empty($str))
        {
            return FALSE;
Severity: Minor
Found in system/libraries/Form_validation.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 send has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function send($auto_clear = TRUE)
    {
        if ( ! isset($this->_headers['From']))
        {
            $this->_set_error_message('lang:email_no_from');
Severity: Minor
Found in system/libraries/Email.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 close has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function close()
    {
        if (isset($this->_redis))
        {
            try {
Severity: Minor
Found in system/libraries/Session/drivers/Session_redis_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 open has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function open($save_path, $name)
    {
        if (empty($this->_config['save_path']))
        {
            return $this->_failure;
Severity: Minor
Found in system/libraries/Session/drivers/Session_redis_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($config = array())
    {
        // Only run this constructor on main library load
        if ( ! in_array(get_class($this), array('CI_Migration', config_item('subclass_prefix').'Migration'), TRUE))
        {
Severity: Minor
Found in system/libraries/Migration.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

                        if ($pt !== $current_sig[$n+1])
                        {
                            $pno = $n+1;
                            $wanted = $current_sig[$n+1];

Severity: Major
Found in system/libraries/Xmlrpcs.php - About 45 mins to fix

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

        protected function _smtp_authenticate()
        {
            if ( ! $this->_smtp_auth)
            {
                return TRUE;
    Severity: Minor
    Found in system/libraries/Email.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 _wh_in has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _wh_in($qb_key, $key, array $values, $not = FALSE, $type = 'AND ', $escape = NULL)
        {
            $qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';
    
            if (empty($key) OR ! is_string($key))
    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

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

        function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
    Severity: Minor
    Found in system/helpers/html_helper.php - About 45 mins to fix

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

          function write_file($path, $data, $mode = 'wb')
          {
              if ( ! $fp = @fopen($path, $mode))
              {
                  return FALSE;
      Severity: Minor
      Found in system/helpers/file_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 add_field has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function add_field($field)
          {
              if (is_string($field))
              {
                  if ($field === 'id')
      Severity: Minor
      Found in system/database/DB_forge.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_binds has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function compile_binds($sql, $binds)
          {
              if (empty($this->bind_marker) OR strpos($sql, $this->bind_marker) === FALSE)
              {
                  return $sql;
      Severity: Minor
      Found in system/database/DB_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 _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/pdo/subdrivers/pdo_dblib_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

      Avoid deeply nested control flow statements.
      Open

                          if ($byte_index === $pool_length)
                          {
                              // No failures should be possible if the
                              // first get_random_bytes() call didn't
                              // return FALSE, but still ...
      Severity: Major
      Found in system/helpers/captcha_helper.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ($rand_index > $rand_max)
                            {
                                continue;
                            }
        Severity: Major
        Found in system/helpers/captcha_helper.php - About 45 mins to fix

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

              protected function _wh_in($qb_key, $key, array $values, $not = FALSE, $type = 'AND ', $escape = NULL)
          Severity: Minor
          Found in system/database/DB_query_builder.php - About 45 mins to fix
            Severity
            Category
            Status
            Source
            Language