bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

CI_DB_driver has 56 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class CI_DB_driver {

    /**
     * Data Source Name / Connect string
     *
Severity: Major
Found in system/database/DB_driver.php - About 1 day to fix

    CI_Form_validation has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class CI_Form_validation {
    
        /**
         * Reference to the CodeIgniter instance
         *
    Severity: Major
    Found in system/libraries/Form_validation.php - About 7 hrs to fix

      Function protect_identifiers has a Cognitive Complexity of 45 (exceeds 5 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: Minor
      Found in system/database/DB_driver.php - About 6 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 Common.php has 448 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/Common.php - About 6 hrs to fix

        Function DB has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

        function &DB($params = '')
        {
            // Load the DB config file if a DSN string wasn't passed
            if (is_string($params) && strpos($params, '://') === FALSE)
            {
        Severity: Minor
        Found in system/database/DB.php - About 6 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 create_links has 168 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function create_links()
            {
                // If our item count or per-page total is zero there is no need to continue.
                // Note: DO NOT change the operator to === here!
                if ($this->total_rows == 0 OR $this->per_page == 0)
        Severity: Major
        Found in system/libraries/Pagination.php - About 6 hrs to fix

          Function generate has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

              public function generate($table_data = NULL)
              {
                  // The table data can optionally be passed to this function
                  // either as a database result object or an array
                  if ( ! empty($table_data))
          Severity: Minor
          Found in system/libraries/Table.php - About 6 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 initialize has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

              public function initialize($props = array())
              {
                  // Convert array elements into class variables
                  if (count($props) > 0)
                  {
          Severity: Minor
          Found in system/libraries/Image_lib.php - About 6 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 do_upload has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

              public function do_upload($field = 'userfile')
              {
                  // Is $_FILES[$field] set? If not, no reason to continue.
                  if (isset($_FILES[$field]))
                  {
          Severity: Minor
          Found in system/libraries/Upload.php - About 6 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 _execute has 151 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
              {
                  $allow_arrays = in_array('is_array', $rules, TRUE);
          
                  // If the $_POST data is an array we will run a recursive call
          Severity: Major
          Found in system/libraries/Form_validation.php - About 6 hrs to fix

            Function _file_mime_type has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function _file_mime_type($file)
                {
                    // We'll need this to validate the MIME info string (e.g. text/plain; charset=us-ascii)
                    $regexp = '/^([a-z\-]+\/[a-z0-9\-\.\+]+)(;\s.+)?$/';
            
            
            Severity: Minor
            Found in system/libraries/Upload.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

            Function safe_mailto has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                function safe_mailto($email, $title = '', $attributes = '')
                {
                    $title = (string) $title;
            
                    if ($title === '')
            Severity: Minor
            Found in system/helpers/url_helper.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

            Function password_hash has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

                function password_hash($password, $algo, array $options = array())
                {
                    static $func_overload;
                    isset($func_overload) OR $func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
            
            
            Severity: Minor
            Found in system/core/compat/password.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

            Function model has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

                public function model($model, $name = '', $db_conn = FALSE)
                {
                    if (empty($model))
                    {
                        return $this;
            Severity: Minor
            Found in system/core/Loader.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

            Function force_download has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                function force_download($filename = '', $data = '', $set_mime = FALSE)
                {
                    if ($filename === '' OR $data === '')
                    {
                        return;
            Severity: Minor
            Found in system/helpers/download_helper.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 do_upload has 138 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function do_upload($field = 'userfile')
                {
                    // Is $_FILES[$field] set? If not, no reason to continue.
                    if (isset($_FILES[$field]))
                    {
            Severity: Major
            Found in system/libraries/Upload.php - About 5 hrs to fix

              File Output.php has 394 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/Output.php - About 5 hrs to fix

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

                    function form_dropdown($data = '', $options = array(), $selected = array(), $extra = '')
                    {
                        $defaults = array();
                
                        if (is_array($data))
                Severity: Minor
                Found in system/helpers/form_helper.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

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

                    protected function _backup($params = array())
                    {
                        if (count($params) === 0)
                        {
                            return FALSE;
                Severity: Minor
                Found in system/database/drivers/mysql/mysql_utility.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

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

                    protected function _backup($params = array())
                    {
                        if (count($params) === 0)
                        {
                            return FALSE;
                Severity: Minor
                Found in system/database/drivers/mysqli/mysqli_utility.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

                Severity
                Category
                Status
                Source
                Language