bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function _configure_sid_length has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _configure_sid_length()
    {
        if (PHP_VERSION_ID < 70100)
        {
            $hash_function = ini_get('session.hash_function');
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 _mcrypt_initialize has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _mcrypt_initialize($params)
    {
        if ( ! empty($params['cipher']))
        {
            $params['cipher'] = strtolower($params['cipher']);
Severity: Minor
Found in system/libraries/Encryption.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 _ci_load_classes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _ci_load_classes($driver)
    {
        // PHP 7 compatibility
        interface_exists('SessionUpdateTimestampHandlerInterface', FALSE) OR require_once(BASEPATH.'libraries/Session/SessionUpdateTimestampHandlerInterface.php');

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 _get_params has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _get_params($params)
    {
        if (empty($params))
        {
            return isset($this->_cipher, $this->_mode, $this->_key, $this->_handle)
Severity: Minor
Found in system/libraries/Encryption.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 get_filenames has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE)
    {
        static $_filedata = array();

        if ($fp = @opendir($source_dir))
Severity: Minor
Found in system/helpers/file_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 _wh has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = NULL)
    {
        $qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';

        if ( ! is_array($key))
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_files has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function delete_files($path, $del_dir = FALSE, $htdocs = FALSE, $_level = 0)
    {
        // Trim the trailing slash
        $path = rtrim($path, '/\\');

Severity: Minor
Found in system/helpers/file_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 get_file_info has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date'))
    {
        if ( ! file_exists($file))
        {
            return FALSE;
Severity: Minor
Found in system/helpers/file_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 form_hidden has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function form_hidden($name, $value = '', $recursing = FALSE)
    {
        static $form;

        if ($recursing === FALSE)
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 _alter_table has a Cognitive Complexity of 15 (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_pgsql_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 15 (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/postgre/postgre_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 _set_uri_string has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _set_uri_string($str, $is_cli = FALSE)
    {
        // CLI requests have a bit simpler logic
        if ($is_cli)
        {
Severity: Minor
Found in system/core/URI.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 _parse_routes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _parse_routes()
    {
        // Turn the segment array into a URI string
        $uri = implode('/', $this->uri->segments);

Severity: Minor
Found in system/core/Router.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 _ci_load_classes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _ci_load_classes($driver)
    {
        // PHP 7 compatibility
        interface_exists('SessionUpdateTimestampHandlerInterface', FALSE) OR require_once(BASEPATH.'libraries/Session/SessionUpdateTimestampHandlerInterface.php');

Severity: Minor
Found in system/libraries/Session/Session.php - About 1 hr to fix

    Method send has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function send($tb_data)
        {
            if ( ! is_array($tb_data))
            {
                $this->set_error('The send() method must be passed an array');
    Severity: Minor
    Found in system/libraries/Trackback.php - About 1 hr to fix

      Method _configure_sid_length has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _configure_sid_length()
          {
              if (PHP_VERSION_ID < 70100)
              {
                  $hash_function = ini_get('session.hash_function');
      Severity: Minor
      Found in system/libraries/Session/Session.php - About 1 hr to fix

        Method timezones has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function timezones($tz = '')
            {
                // Note: Don't change the order of these even though
                // some items appear to be in the wrong order
        
        
        Severity: Minor
        Found in system/helpers/date_helper.php - About 1 hr to fix

          Method db_connect has 47 lines of code (exceeds 25 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

            Method initialize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function initialize(array $config = array(), $reset = TRUE)
                {
                    $reflection = new ReflectionClass($this);
            
                    if ($reset === TRUE)
            Severity: Minor
            Found in system/libraries/Upload.php - About 1 hr to fix

              Method field_data has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function field_data($table)
                  {
                      $sql = 'SELECT "syscolumns"."colname" AS "name",
                              CASE "syscolumns"."coltype"
                                  WHEN 0 THEN \'CHAR\'
              Severity: Minor
              Found in system/database/drivers/pdo/subdrivers/pdo_informix_driver.php - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language