bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function convert_ascii has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function convert_ascii($str)
    {
        $count    = 1;
        $out    = '';
        $temp    = array();
Severity: Minor
Found in system/libraries/Trackback.php - About 1 hr 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_lock has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _get_lock($session_id)
    {
        // PHP 7 reuses the SessionHandler object on regeneration,
        // so we need to check here if the lock key is for the
        // correct session ID.
Severity: Minor
Found in system/libraries/Session/drivers/Session_redis_driver.php - About 1 hr 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 image_process_imagemagick has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function image_process_imagemagick($action = 'resize')
    {
        // Do we have a vaild library path?
        if ($this->library_path === '')
        {
Severity: Minor
Found in system/libraries/Image_lib.php - About 1 hr 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 open has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function open($save_path, $name)
    {
        $this->_memcached = new Memcached();
        $this->_memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, TRUE); // required for touch() usage
        $server_list = array();
Severity: Minor
Found in system/libraries/Session/drivers/Session_memcached_driver.php - About 1 hr 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 methodSignature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function methodSignature($m)
    {
        $parameters = $m->output_parameters();
        $method_name = $parameters[0];

Severity: Minor
Found in system/libraries/Xmlrpcs.php - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function initialize(array $params)
    {
        if ( ! empty($params['driver']))
        {
            if (isset($this->_drivers[$params['driver']]))
Severity: Minor
Found in system/libraries/Encryption.php - About 1 hr 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_init_vars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _ci_init_vars()
    {
        if ( ! empty($_SESSION['__ci_vars']))
        {
            $current_time = time();
Severity: Minor
Found in system/libraries/Session/Session.php - About 1 hr 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_checkbox has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '')
    {
        $defaults = array('type' => 'checkbox', 'name' => ( ! is_array($data) ? $data : ''), 'value' => $value);

        if (is_array($data) && array_key_exists('checked', $data))
Severity: Minor
Found in system/helpers/form_helper.php - About 1 hr 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 list_tables has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function list_tables($constrain_by_prefix = FALSE)
    {
        // Is there a cached result?
        if (isset($this->data_cache['table_names']))
        {
Severity: Minor
Found in system/database/DB_driver.php - About 1 hr 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 anchor_popup has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function anchor_popup($uri = '', $title = '', $attributes = FALSE)
    {
        $title = (string) $title;
        $site_url = preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri);

Severity: Minor
Found in system/helpers/url_helper.php - About 1 hr 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 set_insert_batch has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function set_insert_batch($key, $value = '', $escape = NULL)
    {
        $key = $this->_object_to_array_batch($key);

        if ( ! is_array($key))
Severity: Minor
Found in system/database/DB_query_builder.php - About 1 hr 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 library has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function library($library, $params = NULL, $object_name = NULL)
    {
        if (empty($library))
        {
            return $this;
Severity: Minor
Found in system/core/Loader.php - About 1 hr 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 csrf_verify has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function csrf_verify()
    {
        // If it's not a POST request we will set the CSRF cookie
        if (strtoupper($_SERVER['REQUEST_METHOD']) !== 'POST')
        {
Severity: Minor
Found in system/core/Security.php - About 1 hr 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 driver has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function driver($library, $params = NULL, $object_name = NULL)
    {
        if (is_array($library))
        {
            foreach ($library as $key => $value)
Severity: Minor
Found in system/core/Loader.php - About 1 hr 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_random_bytes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_random_bytes($length)
    {
        if (empty($length) OR ! ctype_digit((string) $length))
        {
            return FALSE;
Severity: Minor
Found in system/core/Security.php - About 1 hr 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 from has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function from($from, $name = '', $return_path = NULL)
    {
        if (preg_match('/\<(.*)\>/', $from, $match))
        {
            $from = $match[1];
Severity: Minor
Found in system/libraries/Email.php - About 1 hr to fix

    Method addScalar has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function addScalar($val, $type = 'string')
        {
            $typeof = $this->xmlrpcTypes[$type];
    
            if ($this->mytype === 1)
    Severity: Minor
    Found in system/libraries/Xmlrpc.php - About 1 hr to fix

      Method write has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function write($session_id, $session_data)
          {
              if ( ! isset($this->_redis, $this->_lock_key))
              {
                  return $this->_failure;
      Severity: Minor
      Found in system/libraries/Session/drivers/Session_redis_driver.php - About 1 hr to fix

        Function SphinxRtdTheme has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        window.SphinxRtdTheme = (function (jquery) {
            var stickyNav = (function () {
                var navBar,
                        win,
                        stickyNavCssClass = 'stickynav',
        Severity: Minor
        Found in user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js - About 1 hr to fix

          Function SphinxRtdTheme has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          window.SphinxRtdTheme = (function (jquery) {
              var stickyNav = (function () {
                  var navBar,
                      win,
                      stickyNavCssClass = 'stickynav',
            Severity
            Category
            Status
            Source
            Language