bcit-ci/CodeIgniter

View on GitHub

Showing 865 of 865 total issues

Avoid too many return statements within this method.
Open

                    return FALSE;
Severity: Major
Found in system/core/compat/password.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return TRUE;
    Severity: Major
    Found in system/core/Hooks.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return TRUE;
      Severity: Major
      Found in system/core/Lang.php - About 30 mins to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            protected function _attr_type(&$attributes)
            {
                switch (strtoupper($attributes['TYPE']))
                {
                    case 'TINYINT':
        Severity: Minor
        Found in system/database/drivers/pdo/subdrivers/pdo_oci_forge.php and 1 other location - About 30 mins to fix
        system/database/drivers/oci8/oci8_forge.php on lines 198..216

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Avoid too many return statements within this method.
        Open

                return defined('MB_OVERLOAD_STRING')
                    ? mb_substr($hash, 0, $length, '8bit')
                    : substr($hash, 0, $length);
        Severity: Major
        Found in system/core/compat/hash.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return $this->_in_progress = FALSE;
          Severity: Major
          Found in system/core/Hooks.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return FALSE;
            Severity: Major
            Found in system/core/Security.php - About 30 mins to fix

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

                  public function initialize($config = array())
                  {
                      if (count($config) > 0)
                      {
                          foreach ($config as $key => $val)
              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 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 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 _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 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 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 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 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 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 _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 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 __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

              Severity
              Category
              Status
              Source
              Language