bcit-ci/CodeIgniter

View on GitHub

Showing 877 of 877 total issues

Function image_display_gd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function image_display_gd($resource)
    {
        // RFC 6266 allows for multibyte filenames, but only in UTF-8,
        // so we have to make it conditional ...
        $filename = basename(empty($this->new_image) ? $this->source_image : $this->new_image);
Severity: Minor
Found in system/libraries/Image_lib.php - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($config = array())
    {
        isset($config['adapter']) && $this->_adapter = $config['adapter'];
        isset($config['backup']) && $this->_backup_driver = $config['backup'];
        isset($config['key_prefix']) && $this->key_prefix = $config['key_prefix'];
Severity: Minor
Found in system/libraries/Cache/Cache.php - About 25 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 character_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function character_data($the_parser, $data)
    {
        $the_parser = (string) $the_parser;

        if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already
Severity: Minor
Found in system/libraries/Xmlrpc.php - About 25 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 reply_to has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function addScalar($val, $type = 'string')
    {
        $typeof = $this->xmlrpcTypes[$type];

        if ($this->mytype === 1)
Severity: Minor
Found in system/libraries/Xmlrpc.php - About 25 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 find_migrations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function find_migrations()
    {
        $migrations = array();

        // Load all *_*.php files in the migrations path
Severity: Minor
Found in system/libraries/Migration.php - About 25 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 unmark_flash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function unmark_flash($key)
    {
        if (empty($_SESSION['__ci_vars']))
        {
            return;
Severity: Minor
Found in system/libraries/Session/Session.php - About 25 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_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function error_string($prefix = '', $suffix = '')
    {
        // No errors, validation passes!
        if (count($this->_error_array) === 0)
        {
Severity: Minor
Found in system/libraries/Form_validation.php - About 25 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 destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function destroy($session_id)
    {
        if ($this->_lock)
        {
            // Prevent previous QB calls from messing with our queries
Severity: Minor
Found in system/libraries/Session/drivers/Session_database_driver.php - About 25 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 get_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_id($url)
    {
        $tb_id = '';

        if (strpos($url, '?') !== FALSE)
Severity: Minor
Found in system/libraries/Trackback.php - About 25 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 _mcrypt_encrypt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _mcrypt_encrypt($data, $params)
    {
        if ( ! is_resource($params['handle']))
        {
            return FALSE;
Severity: Minor
Found in system/libraries/Encryption.php - About 25 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 unmark_temp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function unmark_temp($key)
    {
        if (empty($_SESSION['__ci_vars']))
        {
            return;
Severity: Minor
Found in system/libraries/Session/Session.php - About 25 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 _get_lock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _get_lock($session_id)
    {
        if ($this->_platform === 'mysql')
        {
            $arg = md5($session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : ''));
Severity: Minor
Found in system/libraries/Session/drivers/Session_database_driver.php - About 25 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 destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function destroy($session_id)
    {
        if ($this->close() === $this->_success)
        {
            if (file_exists($this->_file_path.$session_id))
Severity: Minor
Found in system/libraries/Session/drivers/Session_files_driver.php - About 25 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 random_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function random_string($type = 'alnum', $len = 8)
    {
        switch ($type)
        {
            case 'basic':
Severity: Minor
Found in system/helpers/string_helper.php - About 25 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 byte_format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function byte_format($num, $precision = 1)
    {
        $CI =& get_instance();
        $CI->lang->load('number');

Severity: Minor
Found in system/helpers/number_helper.php - About 25 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 xml_from_result has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function xml_from_result(CI_DB_result $query, $params = array())
    {
        // Set our default values
        foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val)
        {
Severity: Minor
Found in system/database/DB_utility.php - About 25 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_realpath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function set_realpath($path, $check_existance = FALSE)
    {
        // Security check to make sure the path is NOT a URL. No remote file inclusion!
        if (preg_match('#^(http:\/\/|https:\/\/|www\.|ftp|php:\/\/)#i', $path) OR filter_var($path, FILTER_VALIDATE_IP) === $path)
        {
Severity: Minor
Found in system/helpers/path_helper.php - About 25 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 6 (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_firebird_driver.php - About 25 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 result_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function result_object()
    {
        if (count($this->result_object) > 0)
        {
            return $this->result_object;
Severity: Minor
Found in system/database/DB_result.php - About 25 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