bcit-ci/CodeIgniter

View on GitHub
system/helpers/html_helper.php

Summary

Maintainability
D
1 day
Test Coverage

Function link_tag has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
    {
        $CI =& get_instance();
        $link = '<link ';

Severity: Minor
Found in system/helpers/html_helper.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

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

Method link_tag has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
    {
        $CI =& get_instance();
        $link = '<link ';

Severity: Minor
Found in system/helpers/html_helper.php - About 1 hr to fix

    Function meta has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        function meta($name = '', $content = '', $type = 'name', $newline = "\n")
        {
            // Since we allow the data to be passes as a string, a simple array
            // or a multidimensional one, we need to do a little prepping.
            if ( ! is_array($name))
    Severity: Minor
    Found in system/helpers/html_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 doctype has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        function doctype($type = 'html5')
        {
            static $doctypes;
    
            if ( ! is_array($doctypes))
    Severity: Minor
    Found in system/helpers/html_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

    Method meta has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function meta($name = '', $content = '', $type = 'name', $newline = "\n")
        {
            // Since we allow the data to be passes as a string, a simple array
            // or a multidimensional one, we need to do a little prepping.
            if ( ! is_array($name))
    Severity: Minor
    Found in system/helpers/html_helper.php - About 1 hr to fix

      Method img has 28 lines of code (exceeds 25 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 1 hr to fix

        Function _list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            function _list($type = 'ul', $list = array(), $attributes = '', $depth = 0)
            {
                // If an array wasn't submitted there's nothing to do...
                if ( ! is_array($list))
                {
        Severity: Minor
        Found in system/helpers/html_helper.php - About 55 mins 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 link_tag has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
        Severity: Minor
        Found in system/helpers/html_helper.php - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status