HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

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

            JpGraphError::RaiseL(25005);
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

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

                JpGraphError::RaiseL(25078, $aColor); //(" Unknown color: $aColor");
Severity: Minor
Found in src/util/RGB.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 'setUpBeforeClass'.
Open

            self::$fixTures = Yaml::parseFile(\sprintf('%s/_support/%s.yml', __DIR__, $className));
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 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' ungrouped files. knownFixtures are:');
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/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

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

        } else {
            Debug::debug(
                'testing ' . $filename .
                ' for dims ' . \implode('x', [$__width, $__height])
            );
Severity: Minor
Found in tests/ImgTest.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 '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' files');
Severity: Minor
Found in tests/TickTest.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 getFiles() contains an exit expression.
Open

            exit("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: {$folder}");
Severity: Minor
Found in tests/UnitTestTrait.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 'Amenadiel\JpGraph\Util\JpGraphError' in method '__construct'.
Open

            JpGraphError::RaiseL(19001);
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 'Amenadiel\JpGraph\Util\JpGraphError' in method 'GetTicksFromMinMax'.
Open

            JpGraphError::RaiseL(24003);
Severity: Minor
Found in src/util/DateScaleUtils.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 '$aHalt'.
Open

    public static function Raise($aMsg, $aHalt = true)
Severity: Minor
Found in src/util/JpGraphError.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 Stroke uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $errobj = new JpGraphErrObject();
            $errobj->SetTitle(JpGraphError::GetTitle());
            $errobj->SetStrokeDest(JpGraphError::GetLogFile());
        }
Severity: Minor
Found in src/util/JpGraphException.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 '\Codeception\Util\Debug' in method 'setUpBeforeClass'.
Open

        Debug::debug(__CLASS__ . ' has ' . \count(self::$files) . ' files');
Severity: Minor
Found in tests/ThemeTest.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 dims ' . \implode('x', [$__width, $__height])
            );
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

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

        } else {
            self::$fixTures = ['testFileIterator' => self::$files];
        }
Severity: Minor
Found in tests/UnitTestTrait.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 _fileCheck uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            Debug::debug(
                'testing ' . $filename .
                    ' for image/jpeg headers '
            );
Severity: Minor
Found in tests/UnitTestTrait.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\Image\Image' in method 'Raise'.
Open

        $erricon = Image\Image::CreateFromString(base64_decode($img_iconerror, true));
Severity: Minor
Found in src/util/JpGraphErrObjectImg.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 Color uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            JpGraphError::RaiseL(25079, $aColor, safe_count($aColor)); //(" Unknown color specification: $aColor , size=". safe_count($aColor));
        }
Severity: Minor
Found in src/util/RGB.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 '\Codeception\Util\Debug' in method 'tearDownAfterClass'.
Open

                Debug::debug(self::$genericFixtures['testFileIterator']);
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 'setUpBeforeClass'.
Open

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