bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function image_process_netpbm has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function image_process_netpbm($action = 'resize')
    {
        if ($this->library_path === '')
        {
            $this->set_error('imglib_libpath_invalid');
Severity: Minor
Found in system/libraries/Image_lib.php - About 2 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 _prep_quoted_printable has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _prep_quoted_printable($str)
    {
        // ASCII code numbers for "safe" characters that can always be
        // used literally, without encoding, as described in RFC 2049.
        // https://www.ietf.org/rfc/rfc2049.txt
Severity: Minor
Found in system/libraries/Email.php - About 2 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function word_wrap($str, $charlim = NULL)
    {
        // Set the character limit, if not already present
        if (empty($charlim))
        {
Severity: Minor
Found in system/libraries/Email.php - About 2 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 __construct has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($params)
    {
        parent::__construct($params);

        if (empty($this->dsn))
Severity: Minor
Found in system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php - About 2 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 __construct has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($params)
    {
        parent::__construct($params);

        if (empty($this->dsn))
Severity: Minor
Found in system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php - About 2 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 _ci_load_library has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _ci_load_library($class, $params = NULL, $object_name = NULL)
    {
        // Get the class name, and while we're at it trim any slashes.
        // The directory path can be included as part of the class name,
        // but we don't want a leading slash
Severity: Minor
Found in system/core/Loader.php - About 2 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 image_save_gd has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function image_save_gd($resource)
    {
        switch ($this->image_type)
        {
            case 1:
Severity: Major
Found in system/libraries/Image_lib.php - About 2 hrs to fix

    Method form_open has 55 lines of code (exceeds 25 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: Major
    Found in system/helpers/form_helper.php - About 2 hrs to fix

      File Trackback.php has 258 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/Trackback.php - About 2 hrs to fix

        Method _send_with_smtp has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _send_with_smtp()
            {
                if ($this->smtp_host === '')
                {
                    $this->_set_error_message('lang:email_no_hostname');
        Severity: Major
        Found in system/libraries/Email.php - About 2 hrs to fix

          Method __construct has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  // Try to load memcached server info from the config file.
                  $CI =& get_instance();
                  $defaults = $this->_config['default'];
          Severity: Major
          Found in system/libraries/Cache/drivers/Cache_memcached.php - About 2 hrs to fix

            Method run has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run($config = NULL, &$data = NULL)
                {
                    $validation_array = empty($this->validation_data)
                        ? $_POST
                        : $this->validation_data;
            Severity: Major
            Found in system/libraries/Form_validation.php - About 2 hrs to fix

              Method _ci_load_stock_library has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _ci_load_stock_library($library_name, $file_path, $params, $object_name)
                  {
                      $prefix = 'CI_';
              
                      if (class_exists($prefix.$library_name, FALSE))
              Severity: Major
              Found in system/core/Loader.php - About 2 hrs to fix

                Function sendPayload has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function sendPayload($msg)
                    {
                        if ($this->proxy === FALSE)
                        {
                            $server = $this->server;
                Severity: Minor
                Found in system/libraries/Xmlrpc.php - About 2 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 _parse_pair has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _parse_pair($variable, $data, $string)
                    {
                        $replace = array();
                        preg_match_all(
                            '#'.preg_quote($this->l_delim.$variable.$this->r_delim).'(.+?)'.preg_quote($this->l_delim.'/'.$variable.$this->r_delim).'#s',
                Severity: Minor
                Found in system/libraries/Parser.php - About 2 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 get_dir_file_info has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    function get_dir_file_info($source_dir, $top_level_only = TRUE, $_recursion = FALSE)
                    {
                        static $_filedata = array();
                        $relative_path = $source_dir;
                
                
                Severity: Minor
                Found in system/helpers/file_helper.php - About 2 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 img has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    function img($src = '', $index_page = FALSE, $attributes = '')
                    {
                        if ( ! is_array($src) )
                        {
                            $src = array('src' => $src);
                Severity: Minor
                Found in system/helpers/html_helper.php - About 2 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_link has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    function auto_link($str, $type = 'both', $popup = FALSE)
                    {
                        // Find and replace any URLs.
                        if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[a-z0-9]+(-+[a-z0-9]+)*(\.[a-z0-9]+(-+[a-z0-9]+)*)+(/([^\s()<>;]+\w)?/?)?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
                        {
                Severity: Minor
                Found in system/helpers/url_helper.php - About 2 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 __construct has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct($params)
                    {
                        parent::__construct($params);
                
                        $valid_dsns = array(
                Severity: Minor
                Found in system/database/drivers/oci8/oci8_driver.php - About 2 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 db_connect has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function db_connect($persistent = FALSE)
                    {
                        if (isset($this->stricton))
                        {
                            if ($this->stricton)
                Severity: Minor
                Found in system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php - About 2 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