bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Method _alter_table has 40 lines of code (exceeds 25 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_pgsql_forge.php - About 1 hr to fix

    Function values_parsing has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function values_parsing($value)
        {
            if (is_array($value) && array_key_exists(0, $value))
            {
                if ( ! isset($value[1], $this->xmlrpcTypes[$value[1]]))
    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 do_xss_clean has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function do_xss_clean()
        {
            $file = $this->file_temp;
    
            if (filesize($file) == 0)
    Severity: Minor
    Found in system/libraries/Upload.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 overlay_watermark has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function overlay_watermark()
        {
            if ( ! function_exists('imagecolortransparent'))
            {
                $this->set_error('imglib_gd_required');
    Severity: Minor
    Found in system/libraries/Image_lib.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 result has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function result($results = array())
        {
            $CI =& get_instance();
            $CI->load->language('unit_test');
    
    
    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 read has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function read($session_id)
        {
            // This might seem weird, but PHP 5.6 introduces session_reset(),
            // which re-reads session data
            if ($this->_file_handle === NULL)
    Severity: Minor
    Found in system/libraries/Session/drivers/Session_files_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 __construct has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            // Try to load memcached server info from the config file.
            $CI =& get_instance();
            $defaults = $this->_config['default'];
    Severity: Minor
    Found in system/libraries/Cache/drivers/Cache_memcached.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 days_in_month has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function days_in_month($month = 0, $year = '')
        {
            if ($month < 1 OR $month > 12)
            {
                return 0;
    Severity: Minor
    Found in system/helpers/date_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 meta has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function meta($name = '', $content = '', $type = 'name', $newline = "\n")
        {
            // Since we allow the data to be passes as a string, a simple array
            // or a multidimensional one, we need to do a little prepping.
            if ( ! is_array($name))
    Severity: Minor
    Found in system/helpers/html_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 update_batch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function update_batch($table, $set = NULL, $index = NULL, $batch_size = 100)
        {
            // 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 redirect has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function redirect($uri = '', $method = 'auto', $code = NULL)
        {
            if ( ! preg_match('#^(\w+:)?//#i', $uri))
            {
                $uri = site_url($uri);
    Severity: Minor
    Found in system/helpers/url_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 set_select has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function set_select($field, $value = '', $default = FALSE)
        {
            $CI =& get_instance();
    
            if (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field))
    Severity: Minor
    Found in system/helpers/form_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 entities_to_ascii has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function entities_to_ascii($str, $all = TRUE)
        {
            if (preg_match_all('/\&#(\d+)\;/', $str, $matches))
            {
                for ($i = 0, $s = count($matches[0]); $i < $s; $i++)
    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 _process_indexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _process_indexes($table)
        {
            $sql = '';
    
            for ($i = 0, $c = count($this->keys); $i < $c; $i++)
    Severity: Minor
    Found in system/database/drivers/mysqli/mysqli_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 _process_indexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _process_indexes($table)
        {
            $sql = '';
    
            for ($i = 0, $c = count($this->keys); $i < $c; $i++)
    Severity: Minor
    Found in system/database/drivers/pdo/subdrivers/pdo_mysql_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 _process_indexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _process_indexes($table)
        {
            $sql = '';
    
            for ($i = 0, $c = count($this->keys); $i < $c; $i++)
    Severity: Minor
    Found in system/database/drivers/pdo/subdrivers/pdo_cubrid_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 escape_identifiers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function escape_identifiers($item, $split = TRUE)
        {
            if ($this->_escape_char === '' OR empty($item) OR in_array($item, $this->_reserved_identifiers))
            {
                return $item;
    Severity: Minor
    Found in system/database/DB_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 _process_indexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _process_indexes($table)
        {
            $sqls = array();
    
            for ($i = 0, $c = count($this->keys); $i < $c; $i++)
    Severity: Minor
    Found in system/database/DB_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 _process_indexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _process_indexes($table)
        {
            $sql = '';
    
            for ($i = 0, $c = count($this->keys); $i < $c; $i++)
    Severity: Minor
    Found in system/database/drivers/mysql/mysql_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 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _alter_table($alter_type, $table, $field)
        {
            if ($alter_type === 'DROP')
            {
                return parent::_alter_table($alter_type, $table, $field);
    Severity: Minor
    Found in system/database/drivers/pdo/subdrivers/pdo_oci_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

    Severity
    Category
    Status
    Source
    Language