Admidio/admidio

View on GitHub
adm_program/system/classes/HtmlTable.php

Summary

Maintainability
B
4 hrs
Test Coverage

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

    private function prepareAndAddColumn(string $type, int $key, $value, int $colspan = 1, int $colspanOffset = 1)
    {
        $columnAttributes = array();

        // set colspan if parameters are set
Severity: Minor
Found in adm_program/system/classes/HtmlTable.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 addRowTypeByArray has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function addRowTypeByArray(string $type, array $arrColumnValues, string $id = '', array $arrAttributes = null, int $colspan = 1, int $colspanOffset = 1)
Severity: Minor
Found in adm_program/system/classes/HtmlTable.php - About 45 mins to fix

    Method addRowByArray has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function addRowByArray(array $arrColumnValues, string $id = '', array $arrAttributes = null, int $colspan = 1, int $colspanOffset = 1)
    Severity: Minor
    Found in adm_program/system/classes/HtmlTable.php - About 35 mins to fix

      Method addRowFooterByArray has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function addRowFooterByArray(array $arrColumnValues, string $id = '', array $arrAttributes = null, int $colspan = 1, int $colspanOffset = 1)
      Severity: Minor
      Found in adm_program/system/classes/HtmlTable.php - About 35 mins to fix

        Method addRowHeadingByArray has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function addRowHeadingByArray(array $arrColumnValues, string $id = '', array $arrAttributes = null, int $colspan = 1, int $colspanOffset = 1)
        Severity: Minor
        Found in adm_program/system/classes/HtmlTable.php - About 35 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct(string $id, HtmlPage $htmlPage = null, $hoverRows = true, bool $datatables = false, string $class = '')
          Severity: Minor
          Found in adm_program/system/classes/HtmlTable.php - About 35 mins to fix

            Method prepareAndAddColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private function prepareAndAddColumn(string $type, int $key, $value, int $colspan = 1, int $colspanOffset = 1)
            Severity: Minor
            Found in adm_program/system/classes/HtmlTable.php - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status