HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Avoid using static access to class '\Codeception\Util\Debug' in method 'tearDownAfterClass'.
Open

                Debug::debug('non grouped fixtures:');
Severity: Minor
Found in tests/UnitTestTrait.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

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

            JpGraphError::RaiseL(19002);
Severity: Minor
Found in src/util/Spline.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

Avoid using static access to class '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' files');
Severity: Minor
Found in tests/BackgroundTest.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

Avoid using static access to class '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' files');
Severity: Minor
Found in tests/ContourTest.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

Avoid using static access to class '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug($knownFixtures);
Severity: Minor
Found in tests/UnitTestTrait.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

Avoid unused parameters such as '$vars'.
Open

    public static function phpErrorHandler($errno, $errmsg, $filename, $linenum, $vars)
Severity: Minor
Found in src/util/Helper.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

        } else {
            $img->Headers();
            $img->Stream();
        }
Severity: Minor
Found in src/util/JpGraphErrObjectImg.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 'Stroke'.
Open

            $errobj->SetTitle(JpGraphError::GetTitle());
Severity: Minor
Found in src/util/JpGraphException.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 __construct() has 448 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function __construct($aImg = null)
    {
        $this->img = $aImg;

        // Conversion array between color names and RGB
Severity: Minor
Found in src/util/RGB.php by phpmd

Avoid unused parameters such as '$class'.
Open

    public static function getFiles($class = '')
Severity: Minor
Found in tests/UnitTestTrait.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

        } else {
            $this->boxed = true;
        }
Severity: Minor
Found in src/text/Text.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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                        } else {
                            if ($i < safe_count($this->iFontArray)) {
                                $font = $this->iFontArray[$i];
                                $aImg->SetFont($font[0], $font[1], $font[2]);
                            } else {
Severity: Minor
Found in src/text/TextProperty.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 'E'.
Open

            JpGraphError::RaiseL(24001);
Severity: Minor
Found in src/util/FuncGenerator.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

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

            JpGraphError::RaiseL(25003, basename($filename), $linenum, $errmsg);
Severity: Minor
Found in src/util/Helper.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 Raise uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                echo $aMsg;
            }
Severity: Minor
Found in src/util/JpGraphErrObject.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 Raise() contains an exit expression.
Open

            exit(1);
Severity: Minor
Found in src/util/JpGraphErrObject.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

Avoid using static access to class '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' files');
Severity: Minor
Found in tests/ScatterTest.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

Avoid using static access to class '\Symfony\Component\Yaml\Yaml' in method 'tearDownAfterClass'.
Open

            $yaml = Yaml::dump(self::$genericFixtures);
Severity: Minor
Found in tests/UnitTestTrait.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

Avoid using static access to class '\Codeception\Util\Debug' in method '_fileCheck'.
Open

            Debug::debug(
                'testing ' . $filename .
                ' for image/jpeg headers '
            );
Severity: Minor
Found in tests/ImgTest.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

Avoid using static access to class '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' files');
Severity: Minor
Found in tests/RotateTest.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

Severity
Category
Status
Source
Language