bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function _ci_init_library has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _ci_init_library($class, $prefix, $config = FALSE, $object_name = NULL)
    {
        // Is there an associated config file for this class? Note: these should always be lowercase
        if ($config === NULL)
        {
Severity: Minor
Found in system/core/Loader.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 __construct has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(array $params = array())
    {
        // No sessions under CLI
        if (is_cli())
        {
Severity: Major
Found in system/libraries/Session/Session.php - About 4 hrs to fix

    File Xmlrpcs.php has 335 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Method parseResponse has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function parseResponse($fp)
          {
              $data = '';
      
              while ($datum = fread($fp, 4096))
      Severity: Major
      Found in system/libraries/Xmlrpc.php - About 3 hrs to fix

        Method DB has 99 lines of code (exceeds 25 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: Major
        Found in system/database/DB.php - About 3 hrs to fix

          Function _process_fields has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _process_fields($create_table = FALSE)
              {
                  $fields = array();
          
                  foreach ($this->fields as $key => $attributes)
          Severity: Minor
          Found in system/database/DB_forge.php - About 3 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 closing_tag has 97 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function closing_tag($the_parser, $name)
              {
                  $the_parser = (string) $the_parser;
          
                  if ($this->xh[$the_parser]['isf'] > 1) return;
          Severity: Major
          Found in system/libraries/Xmlrpc.php - About 3 hrs to fix

            Method db_connect has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function db_connect($persistent = FALSE)
                {
                    // PHP 8.1 changes default error handling mode from silent to exceptions - reverse that
                    if (is_php('8.1'))
                    {
            Severity: Major
            Found in system/database/drivers/mysqli/mysqli_driver.php - About 3 hrs to fix

              Method model has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function model($model, $name = '', $db_conn = FALSE)
                  {
                      if (empty($model))
                      {
                          return $this;
              Severity: Major
              Found in system/core/Loader.php - About 3 hrs to fix

                File Profiler.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Method xss_clean has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function xss_clean($str, $is_image = FALSE)
                      {
                          // Is the string an array?
                          if (is_array($str))
                          {
                  Severity: Major
                  Found in system/core/Security.php - About 3 hrs to fix

                    Method ip_address has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function ip_address()
                        {
                            if ($this->ip_address !== FALSE)
                            {
                                return $this->ip_address;
                    Severity: Major
                    Found in system/core/Input.php - About 3 hrs to fix

                      Function text_watermark has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function text_watermark()
                          {
                              if ( ! ($src_img = $this->image_create_gd()))
                              {
                                  return FALSE;
                      Severity: Minor
                      Found in system/libraries/Image_lib.php - About 3 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 _execute has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function _execute($m)
                          {
                              $methName = $m->method_name;
                      
                              // Check to see if it is a system call
                      Severity: Minor
                      Found in system/libraries/Xmlrpcs.php - About 3 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 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function backup($params = array())
                          {
                              // If the parameters have not been submitted as an
                              // array then we know that it is simply the table
                              // name, which is a valid short cut.
                      Severity: Minor
                      Found in system/database/DB_utility.php - About 3 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 auto_typography has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function auto_typography($str, $reduce_linebreaks = FALSE)
                          {
                              if ($str === '')
                              {
                                  return '';
                      Severity: Major
                      Found in system/libraries/Typography.php - About 3 hrs to fix

                        Method version has 91 lines of code (exceeds 25 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: Major
                        Found in system/libraries/Migration.php - About 3 hrs to fix

                          CI_Loader has 29 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class CI_Loader {
                          
                              // All these are set automatically. Don't mess with them.
                              /**
                               * Nesting level of the output buffering mechanism
                          Severity: Minor
                          Found in system/core/Loader.php - About 3 hrs to fix

                            Method generate has 87 lines of code (exceeds 25 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: Major
                            Found in system/libraries/Table.php - About 3 hrs to fix

                              File text_helper.php has 310 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/text_helper.php - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language