HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function StrokePlotArea has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokePlotArea()
    {
        // Note: To be consistent we really should take a possible shadow
        // into account. However, that causes some problem for the LinearScale class
        // since in the current design it does not have any links to class Graph which
Severity: Minor
Found in src/graph/Graph.php - About 25 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

Function NormalizeDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function NormalizeDate($aDate)
    {
        if ($aDate === false) {
            return false;
        }
Severity: Minor
Found in src/graph/GanttScale.php - About 25 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

Function GetHeaderHeight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetHeaderHeight()
    {
        $img    = $this->iImg;
        $height = 1;
        if ($this->minute->iShowLabels) {
Severity: Minor
Found in src/graph/GanttScale.php - About 25 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

Function Translate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function Translate($a)
    {
        if (!is_numeric($a)) {
            if ($a != '' && $a != '-' && $a != 'x') {
                Util\JpGraphError::RaiseL(11001);
Severity: Minor
Found in src/graph/LogScale.php - About 25 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

Function SetColorIndication has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetColorIndication(array $aSpec, array $aColors = null)
    {
        if (safe_count($aSpec) !== 3) {
            Util\JpGraphError::Raise('Specification of scale values for background indicators must be an array with three elements.');
        }
Severity: Minor
Found in src/graph/CCBPGraph.php - About 25 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

Function tearDownAfterClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function tearDownAfterClass(): void
    {
        $arr = \explode('\\', static::class);
        $className = \array_pop($arr);

Severity: Minor
Found in tests/UnitTestTrait.php - About 25 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

Severity
Category
Status
Source
Language