bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function hash_pbkdf2 has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    function hash_pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = FALSE)
    {
        if ( ! in_array(strtolower($algo), hash_algos(), TRUE))
        {
            trigger_error('hash_pbkdf2(): Unknown hashing algorithm: '.$algo, E_USER_WARNING);
Severity: Minor
Found in system/core/compat/hash.php - About 5 hrs 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 _build_message has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _build_message()
    {
        if ($this->wordwrap === TRUE && $this->mailtype !== 'html')
        {
            $this->_body = $this->word_wrap($this->_body);
Severity: Major
Found in system/libraries/Email.php - About 5 hrs to fix

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

        public function initialize($props = array())
        {
            // Convert array elements into class variables
            if (count($props) > 0)
            {
    Severity: Major
    Found in system/libraries/Image_lib.php - About 4 hrs to fix

      Function version has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          public function version($target_version)
          {
              // Note: We use strings, so that timestamp versions work on 32-bit systems
              $current_version = $this->_get_version();
      
      
      Severity: Minor
      Found in system/libraries/Migration.php - About 4 hrs 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 timespan has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          function timespan($seconds = 1, $time = '', $units = 7)
          {
              $CI =& get_instance();
              $CI->lang->load('date');
      
      
      Severity: Minor
      Found in system/helpers/date_helper.php - About 4 hrs 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

      File date_helper.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * CodeIgniter
       *
       * An open source application development framework for PHP
      Severity: Minor
      Found in system/helpers/date_helper.php - About 4 hrs to fix

        Method hash_pbkdf2 has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function hash_pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = FALSE)
            {
                if ( ! in_array(strtolower($algo), hash_algos(), TRUE))
                {
                    trigger_error('hash_pbkdf2(): Unknown hashing algorithm: '.$algo, E_USER_WARNING);
        Severity: Major
        Found in system/core/compat/hash.php - About 4 hrs to fix

          File Input.php has 353 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * CodeIgniter
           *
           * An open source application development framework for PHP
          Severity: Minor
          Found in system/core/Input.php - About 4 hrs to fix

            Function _compile_queries has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function _compile_queries()
                {
                    $dbs = array();
            
                    // Let's determine which databases are currently connected to
            Severity: Minor
            Found in system/libraries/Profiler.php - About 4 hrs 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 word_wrap has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                function word_wrap($str, $charlim = 76)
                {
                    // Set the character limit
                    is_numeric($charlim) OR $charlim = 76;
            
            
            Severity: Minor
            Found in system/helpers/text_helper.php - About 4 hrs 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 generate has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function generate($year = '', $month = '', $data = array())
                {
                    $local_time = time();
            
                    // Set and validate the supplied month/year
            Severity: Major
            Found in system/libraries/Calendar.php - About 4 hrs to fix

              Function link_tag has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
              Open

                  function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
                  {
                      $CI =& get_instance();
                      $link = '<link ';
              
              
              Severity: Minor
              Found in system/helpers/html_helper.php - About 4 hrs 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 query has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function query($sql, $binds = FALSE, $return_object = NULL)
                  {
                      if ($sql === '')
                      {
                          log_message('error', 'Invalid query: '.$sql);
              Severity: Minor
              Found in system/database/DB_driver.php - About 4 hrs 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 text_watermark has 106 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function text_watermark()
                  {
                      if ( ! ($src_img = $this->image_create_gd()))
                      {
                          return FALSE;
              Severity: Major
              Found in system/libraries/Image_lib.php - About 4 hrs to fix

                Method protect_identifiers has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function protect_identifiers($item, $prefix_single = FALSE, $protect_identifiers = NULL, $field_exists = TRUE)
                    {
                        if ( ! is_bool($protect_identifiers))
                        {
                            $protect_identifiers = $this->_protect_identifiers;
                Severity: Major
                Found in system/database/DB_driver.php - About 4 hrs to fix

                  Function initialize has a Cognitive Complexity of 28 (exceeds 5 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 4 hrs 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 generate has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function generate($year = '', $month = '', $data = array())
                      {
                          $local_time = time();
                  
                          // Set and validate the supplied month/year
                  Severity: Minor
                  Found in system/libraries/Calendar.php - About 4 hrs 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 auto_typography has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function auto_typography($str, $reduce_linebreaks = FALSE)
                      {
                          if ($str === '')
                          {
                              return '';
                  Severity: Minor
                  Found in system/libraries/Typography.php - About 4 hrs 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 load_driver has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function load_driver($child)
                      {
                          // Get CodeIgniter instance and subclass prefix
                          $prefix = config_item('subclass_prefix');
                  
                  
                  Severity: Minor
                  Found in system/libraries/Driver.php - About 4 hrs 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 array_column has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function array_column(array $array, $column_key, $index_key = NULL)
                      {
                          if ( ! in_array($type = gettype($column_key), array('integer', 'string', 'NULL'), TRUE))
                          {
                              if ($type === 'double')
                  Severity: Minor
                  Found in system/core/compat/standard.php - About 4 hrs 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