HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

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

    public function SetBackgroundImage($aFileName, $aBgType = BGIMG_FILLPLOT, $aImgFormat = 'auto')
    {
        // Get extension to determine image type
        if ($aImgFormat == 'auto') {
            $e = explode('.', $aFileName);
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 InitScaleConstants has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function InitScaleConstants()
    {
        // Setup scale constants
        if ($this->yscale) {
            $this->yscale->InitConstants($this->img);
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 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

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

Severity
Category
Status
Source
Language