bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

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

    protected function _uri_to_assoc($n = 3, $default = array(), $which = 'segment')
    {
        if ( ! is_numeric($n))
        {
            return $default;
Severity: Minor
Found in system/core/URI.php - About 1 hr to fix

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

      Method compile_binds has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function compile_binds($sql, $binds)
          {
              if (empty($binds) OR empty($this->bind_marker) OR strpos($sql, $this->bind_marker) === FALSE)
              {
                  return $sql;
      Severity: Minor
      Found in system/database/drivers/odbc/odbc_driver.php - About 1 hr to fix

        Method __construct has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __construct($config = array())
            {
                $this->xmlrpc_backslash = chr(92).chr(92);
        
                // Types for info sent back and forth
        Severity: Minor
        Found in system/libraries/Xmlrpc.php - About 1 hr to fix

          Method image_process_imagemagick has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function image_process_imagemagick($action = 'resize')
              {
                  // Do we have a vaild library path?
                  if ($this->library_path === '')
                  {
          Severity: Minor
          Found in system/libraries/Image_lib.php - About 1 hr to fix

            Method singular has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function singular($str)
                {
                    $result = strval($str);
            
                    if ( ! word_is_countable($result))
            Severity: Minor
            Found in system/helpers/inflector_helper.php - About 1 hr to fix

              Function image_save_gd has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function image_save_gd($resource)
                  {
                      switch ($this->image_type)
                      {
                          case 1:
              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 parseRequest has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function parseRequest($data = '')
                  {
                      //-------------------------------------
                      //  Get Data
                      //-------------------------------------
              Severity: Minor
              Found in system/libraries/Xmlrpcs.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 write has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function write($session_id, $session_data)
                  {
                      // If the two IDs don't match, we have a session_regenerate_id() call
                      // and we need to close the old handle and open a new one
                      if ($session_id !== $this->_session_id && ($this->close() === $this->_failure OR $this->read($session_id) === $this->_failure))
              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 _send_command has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _send_command($cmd, $data = '')
                  {
                      switch ($cmd)
                      {
                          case 'hello':
              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 date_range has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  function date_range($unix_start = '', $mixed = '', $is_unix = TRUE, $format = 'Y-m-d')
                  {
                      if ($unix_start == '' OR $mixed == '' OR $format == '')
                      {
                          return FALSE;
              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 join has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function join($table, $cond, $type = '', $escape = NULL)
                  {
                      $type = trim(strtoupper($type).' JOIN');
                      preg_match('#^(NATURAL\s+)?((LEFT|RIGHT|FULL)\s+)?((INNER|OUTER)\s+)?JOIN$#', $type) OR $type = 'JOIN';
              
              
              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 _merge_cache has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _merge_cache()
                  {
                      if (count($this->qb_cache_exists) === 0)
                      {
                          return;
              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 set_radio has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  function set_radio($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 from has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function from($from)
                  {
                      foreach ((array) $from as $val)
                      {
                          if (strpos($val, ',') !== FALSE)
              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 _like has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL)
                  {
                      if ( ! is_array($field))
                      {
                          $field = array($field => $match);
              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 set_checkbox has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  function set_checkbox($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 __construct has a Cognitive Complexity of 14 (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_informix_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 create_table has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function create_table($table, $if_not_exists = FALSE, array $attributes = array())
                  {
                      if ($table === '')
                      {
                          show_error('A table name is required for that operation.');
              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 write_log has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function write_log($level, $msg)
                  {
                      if ($this->_enabled === FALSE)
                      {
                          return FALSE;
              Severity: Minor
              Found in system/core/Log.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