piotrpolak/pepiscms

View on GitHub
pepiscms/application/helpers/dialog_message_helper.php

Summary

Maintainability
B
6 hrs
Test Coverage

Function display_steps has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function display_steps($steps, $type)
    {
        $html = '';
        $html .= '<nav class="steps ' . $type . '">' . "\n";
        $i = 0;
Severity: Minor
Found in pepiscms/application/helpers/dialog_message_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 display_steps has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function display_steps($steps, $type)
    {
        $html = '';
        $html .= '<nav class="steps ' . $type . '">' . "\n";
        $i = 0;
Severity: Minor
Found in pepiscms/application/helpers/dialog_message_helper.php - About 1 hr to fix

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

        function display_action_bar($actions)
        {
            if (count($actions) == 0) {
                return false;
            }
    Severity: Minor
    Found in pepiscms/application/helpers/dialog_message_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 dashboard_box has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function dashboard_box($name, $url, $icon_path = false, $description = false, $is_popup = false, $target = false)
    Severity: Minor
    Found in pepiscms/application/helpers/dialog_message_helper.php - About 45 mins to fix

      Function display_breadcrumb has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function display_breadcrumb($breadcrumb_array, $icon = false)
          {
              $count = count($breadcrumb_array);
      
              $o = '';
      Severity: Minor
      Found in pepiscms/application/helpers/dialog_message_helper.php - About 45 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 button_generic has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function button_generic($label, $url, $icon_path, $extra_classes = '', $id = false)
      Severity: Minor
      Found in pepiscms/application/helpers/dialog_message_helper.php - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status