bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function output_parameters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function output_parameters(array $array = array())
    {
        $CI =& get_instance();

        if ( ! empty($array))
Severity: Minor
Found in system/libraries/Xmlrpc.php - About 1 hr 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 report has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function report($result = array())
    {
        if (count($result) === 0)
        {
            $result = $this->result();
Severity: Minor
Found in system/libraries/Unit_test.php - About 1 hr 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 _prep_q_encoding has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _prep_q_encoding($str)
    {
        $str = str_replace(array("\r", "\n"), '', $str);

        if ($this->charset === 'UTF-8')
Severity: Minor
Found in system/libraries/Email.php - About 1 hr 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_data has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _send_data($data)
    {
        $data .= $this->newline;
        for ($written = $timestamp = 0, $length = self::strlen($data); $written < $length; $written += $result)
        {
Severity: Minor
Found in system/libraries/Email.php - About 1 hr 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 receive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function receive()
    {
        foreach (array('url', 'title', 'blog_name', 'excerpt') as $val)
        {
            if (empty($_POST[$val]))
Severity: Minor
Found in system/libraries/Trackback.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(&$params)
    {
        parent::__construct($params);

        // Detect the names of some methods in phpRedis instance
Severity: Minor
Found in system/libraries/Session/drivers/Session_redis_driver.php - About 1 hr 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 _configure has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _configure(&$params)
    {
        $expiration = config_item('sess_expiration');

        if (isset($params['cookie_lifetime']))
Severity: Minor
Found in system/libraries/Session/Session.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        if ( ! $this->is_supported())
        {
            log_message('error', 'Cache: Failed to create Redis object; extension not loaded?');
Severity: Minor
Found in system/libraries/Cache/drivers/Cache_redis.php - About 1 hr 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 insert_batch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function insert_batch($table, $set = NULL, $escape = NULL, $batch_size = 100)
    {
        if ($set === NULL)
        {
            if (empty($this->qb_set))
Severity: Minor
Found in system/database/DB_query_builder.php - About 1 hr 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 delete has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE)
    {
        // Combine any cached components with the current statements
        $this->_merge_cache();

Severity: Minor
Found in system/database/DB_query_builder.php - About 1 hr 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 word_censor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function word_censor($str, $censored, $replacement = '')
    {
        if ( ! is_array($censored))
        {
            return $str;
Severity: Minor
Found in system/helpers/text_helper.php - About 1 hr 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 db_connect has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function db_connect($persistent = FALSE)
    {
        $client_flags = ($this->compress === FALSE) ? 0 : MYSQL_CLIENT_COMPRESS;

        if ($this->encrypt === TRUE)
Severity: Minor
Found in system/database/drivers/mysql/mysql_driver.php - About 1 hr 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 _alter_table has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _alter_table($alter_type, $table, $field)
    {
        if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
        {
            return parent::_alter_table($alter_type, $table, $field);
Severity: Minor
Found in system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php - About 1 hr 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 _alter_table has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _alter_table($alter_type, $table, $field)
    {
        if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
        {
            return parent::_alter_table($alter_type, $table, $field);
Severity: Minor
Found in system/database/drivers/ibase/ibase_forge.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($params)
    {
        parent::__construct($params);

        if (empty($this->dsn))
Severity: Minor
Found in system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php - About 1 hr 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 batch_bcc_send has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function batch_bcc_send()
    {
        $float = $this->bcc_batch_size - 1;
        $set = '';
        $chunk = array();
Severity: Minor
Found in system/libraries/Email.php - About 1 hr to fix

    Method get_random_bytes has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_random_bytes($length)
        {
            if (empty($length) OR ! ctype_digit((string) $length))
            {
                return FALSE;
    Severity: Minor
    Found in system/core/Security.php - About 1 hr to fix

      Method _add_data has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _add_data($filepath, $data, $file_mtime, $file_mdate)
          {
              $filepath = str_replace('\\', '/', $filepath);
      
              $uncompressed_size = self::strlen($data);
      Severity: Minor
      Found in system/libraries/Zip.php - About 1 hr to fix

        Method _compile_post has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _compile_post()
            {
                $output = "\n\n"
                    .'<fieldset id="ci_profiler_post" style="border:1px solid #009900;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee;">'
                    ."\n"
        Severity: Minor
        Found in system/libraries/Profiler.php - About 1 hr to fix

          Method _openssl_initialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _openssl_initialize($params)
              {
                  if ( ! empty($params['cipher']))
                  {
                      $params['cipher'] = strtolower($params['cipher']);
          Severity: Minor
          Found in system/libraries/Encryption.php - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language