bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function parseResponse has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseResponse($fp)
    {
        $data = '';

        while ($datum = fread($fp, 4096))
Severity: Minor
Found in system/libraries/Xmlrpc.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 closing_tag has a Cognitive Complexity of 24 (exceeds 5 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: Minor
Found in system/libraries/Xmlrpc.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 load has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
    {
        if (is_array($langfile))
        {
            foreach ($langfile as $value)
Severity: Minor
Found in system/core/Lang.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 query has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function query($sql, $binds = FALSE, $return_object = NULL)
    {
        if ($sql === '')
        {
            log_message('error', 'Invalid query: '.$sql);
Severity: Major
Found in system/database/DB_driver.php - About 3 hrs to fix

    CI_Upload has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class CI_Upload {
    
        /**
         * Maximum file size
         *
    Severity: Minor
    Found in system/libraries/Upload.php - About 3 hrs to fix

      CI_Session has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class CI_Session {
      
          /**
           * Userdata array
           *
      Severity: Minor
      Found in system/libraries/Session/Session.php - About 3 hrs to fix

        File Ftp.php has 305 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/Ftp.php - About 3 hrs to fix

          Method _backup has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _backup($params = array())
              {
                  if (count($params) === 0)
                  {
                      return FALSE;
          Severity: Major
          Found in system/database/drivers/mysql/mysql_utility.php - About 3 hrs to fix

            Function db_connect has a Cognitive Complexity of 23 (exceeds 5 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: Minor
            Found in system/database/drivers/mysqli/mysqli_driver.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 form_open has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                function form_open($action = '', $attributes = array(), $hidden = array())
                {
                    $CI =& get_instance();
            
                    // If no action is provided then set to the current url
            Severity: Minor
            Found in system/helpers/form_helper.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 _display has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _display($output = NULL)
                {
                    // Note:  We use load_class() because we can't use $CI =& get_instance()
                    // since this function is sometimes called by the caching mechanism,
                    // which happens before the CI super object is available.
            Severity: Minor
            Found in system/core/Output.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 load has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
                {
                    $file = ($file === '') ? 'config' : str_replace('.php', '', $file);
                    $loaded = FALSE;
            
            
            Severity: Minor
            Found in system/core/Config.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 helper has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                public function helper($helpers = array())
                {
                    is_array($helpers) OR $helpers = array($helpers);
                    foreach ($helpers as &$helper)
                    {
            Severity: Minor
            Found in system/core/Loader.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 _backup has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _backup($params = array())
                {
                    if (count($params) === 0)
                    {
                        return FALSE;
            Severity: Major
            Found in system/database/drivers/mysqli/mysqli_utility.php - About 3 hrs to fix

              Method set_status_header has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function set_status_header($code = 200, $text = '')
                  {
                      if (is_cli())
                      {
                          return;
              Severity: Major
              Found in system/core/Common.php - About 3 hrs to fix

                Method password_hash has 80 lines of code (exceeds 25 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: Major
                Found in system/core/compat/password.php - About 3 hrs to fix

                  Method force_download has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function force_download($filename = '', $data = '', $set_mime = FALSE)
                      {
                          if ($filename === '' OR $data === '')
                          {
                              return;
                  Severity: Major
                  Found in system/helpers/download_helper.php - About 3 hrs to fix

                    Function _ci_load has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _ci_load($_ci_data)
                        {
                            // Set the default data variables
                            foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val)
                            {
                    Severity: Minor
                    Found in system/core/Loader.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 _process_fields has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function _process_fields($create_table = FALSE)
                        {
                            $fields = array();
                    
                            foreach ($this->fields as $key => $attributes)
                    Severity: Major
                    Found in system/database/DB_forge.php - About 3 hrs to fix

                      Method safe_mailto has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function safe_mailto($email, $title = '', $attributes = '')
                          {
                              $title = (string) $title;
                      
                              if ($title === '')
                      Severity: Major
                      Found in system/helpers/url_helper.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language