HuasoFoundries/jpgraph

View on GitHub
src/plot/AccLinePlot.php

Summary

Maintainability
C
1 day
Test Coverage

Function LineInterpolate has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    public function LineInterpolate(&$aData)
    {
        $n = safe_count($aData);
        $i = 0;

Severity: Minor
Found in src/plot/AccLinePlot.php - About 6 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 LineInterpolate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function LineInterpolate(&$aData)
    {
        $n = safe_count($aData);
        $i = 0;

Severity: Minor
Found in src/plot/AccLinePlot.php - About 1 hr to fix

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

        public function Stroke($img, $xscale, $yscale)
        {
            $img->SetLineWeight($this->weight);
            $this->numpoints = safe_count($this->plots[0]->coords[0]);
            // Allocate array
    Severity: Minor
    Found in src/plot/AccLinePlot.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

    The method LineInterpolate() has an NPath complexity of 637. The configured NPath complexity threshold is 200.
    Open

        public function LineInterpolate(&$aData)
        {
            $n = safe_count($aData);
            $i = 0;
    
    
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

    Source https://phpmd.org/rules/codesize.html#npathcomplexity

    The method LineInterpolate() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
    Open

        public function LineInterpolate(&$aData)
        {
            $n = safe_count($aData);
            $i = 0;
    
    
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Avoid using undefined variables such as '$tmp' which will lead to PHP notices.
    Open

                    $tmp[$i]          = $p->coords[0][$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$tmp' which will lead to PHP notices.
    Open

                $p->coords[0][] = $tmp;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$coords' which will lead to PHP notices.
    Open

                    $coords[$j][$i] = $this->plots[$j]->coords[0][$i] + $accy;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$coords' which will lead to PHP notices.
    Open

            $coords[$this->nbrplots][$this->numpoints] = 0;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$tmp' which will lead to PHP notices.
    Open

                    $p->coords[0][$i] = $tmp[$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$coords' which will lead to PHP notices.
    Open

                $accy          = $coords[0][$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$coords' which will lead to PHP notices.
    Open

                    $p->coords[0][$i] = $coords[$j][$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$coords' which will lead to PHP notices.
    Open

                    $accy           = $coords[$j][$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$coords' which will lead to PHP notices.
    Open

                $coords[0][$i] = $this->plots[0]->coords[0][$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    The method LineInterpolate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                    } else {
                        // There are no valid end point. The '-' goes all the way to the end
                        // In that case we just set all the remaining values the the same as the
                        // last valid data point.
                        for ($j = $pstart + 1; $j < $n; ++$j) {
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method LineInterpolate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                        } else {
                            $aData[$j] = $aData[$i];
                        }
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class '\Amenadiel\JpGraph\Util\JpGraphError' in method '__construct'.
    Open

                    Util\JpGraphError::RaiseL(10003); //('Each plot in an accumulated lineplot must have the same number of data points',0)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    The method LineInterpolate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    // All '-' => Error
                    return false;
                }
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method LineInterpolate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                            } else {
                                $aData[$j] = $aData[$pstart];
                            }
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method PreStrokeAdjust uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    $a = 0;
                    $b = 0;
                }
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            for ($i = 0; $i < $n; ++$i) {
                $nc          = safe_count($this->plots[$i]->coords[0]);
                $nmax        = max($nmax, $nc);
                list($x, $y) = $this->plots[$i]->Min();
                $xmin        = min($xmin, $x);
    Severity: Major
    Found in src/plot/AccLinePlot.php and 1 other location - About 1 hr to fix
    src/plot/AccBarPlot.php on lines 121..127

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 101.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            for ($i = 0; $i < $nmax; ++$i) {
                // Get y-value for line $i by adding the
                // individual bars from all the plots added.
                // It would be wrong to just add the
                // individual plots max y-value since that
    Severity: Minor
    Found in src/plot/AccLinePlot.php and 1 other location - About 45 mins to fix
    src/plot/AccLinePlot.php on lines 96..107

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            for ($i = 0; $i < $nmax; ++$i) {
                // Get y-value for line $i by adding the
                // individual bars from all the plots added.
                // It would be wrong to just add the
                // individual plots min y-value since that
    Severity: Minor
    Found in src/plot/AccLinePlot.php and 1 other location - About 45 mins to fix
    src/plot/AccLinePlot.php on lines 67..78

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Avoid variables with short names like $nc. Configured minimum length is 3.
    Open

                $nc          = safe_count($this->plots[$i]->coords[0]);
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $p. Configured minimum length is 3.
    Open

                $p = $this->plots[$j];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $n. Configured minimum length is 3.
    Open

            $n = safe_count($aData);
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $k. Configured minimum length is 3.
    Open

                        $k    = ($aData[$pend] - $aData[$pstart]) / $size;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $y. Configured minimum length is 3.
    Open

                $y = $this->plots[0]->coords[0][$i];
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $b. Configured minimum length is 3.
    Open

                    $b = 0.5;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $x. Configured minimum length is 3.
    Open

                list($x) = $this->plots[$i]->Max();
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $x. Configured minimum length is 3.
    Open

                list($x, $y) = $this->plots[$i]->Min();
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $n. Configured minimum length is 3.
    Open

            $n          = safe_count($this->plots);
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $a. Configured minimum length is 3.
    Open

                    $a = 0.5;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $nc. Configured minimum length is 3.
    Open

                $nc      = safe_count($this->plots[$i]->coords[0]);
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $n. Configured minimum length is 3.
    Open

            $n                    = safe_count($this->plots);
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $i. Configured minimum length is 3.
    Open

            $i = 0;
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Avoid variables with short names like $y. Configured minimum length is 3.
    Open

                list($x, $y) = $this->plots[$i]->Min();
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Method name "AccLinePlot::Legend" is not in camel caps format
    Open

        public function Legend($graph)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Method name "AccLinePlot::Min" is not in camel caps format
    Open

        public function Min()
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Method name "AccLinePlot::PreStrokeAdjust" is not in camel caps format
    Open

        public function PreStrokeAdjust($graph)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Method name "AccLinePlot::Stroke" is not in camel caps format
    Open

        public function Stroke($img, $xscale, $yscale)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Method name "AccLinePlot::SetInterpolateMode" is not in camel caps format
    Open

        public function SetInterpolateMode($aIntMode)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Method name "AccLinePlot::LineInterpolate" is not in camel caps format
    Open

        public function LineInterpolate(&$aData)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Method name "AccLinePlot::Max" is not in camel caps format
    Open

        public function Max()
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    Line exceeds 120 characters; contains 135 characters
    Open

                    Util\JpGraphError::RaiseL(10003); //('Each plot in an accumulated lineplot must have the same number of data points',0)
    Severity: Minor
    Found in src/plot/AccLinePlot.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status