kylekatarnls/jade-php

View on GitHub

Showing 115 of 115 total issues

Avoid using static access to class '\NodejsPhpFallback\NodejsPhpFallback' in method 'renderWithJs'.
Open

                json_encode(realpath(NodejsPhpFallback::getPrefixPath() . '/require.js')) .
Severity: Minor
Found in src/Pug/Engine/PugJsEngine.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 'Pug\Pug' in method '__callStatic'.
Open

        Pug::init();
Severity: Minor
Found in src/Pug/Facade.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 '$options'.
Open

    public function __invoke($code, array $options = null)
Severity: Minor
Found in src/Pug/Filter/Php.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

Avoid using static access to class '\Phug\Phug' in method 'init'.
Open

        Phug::setRendererClassName(static::class);
Severity: Minor
Found in src/Pug/Pug.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 '\Phug\Phug' in method 'addExtension'.
Open

            $options = Phug::getExtensionsOptions([$extension]);
Severity: Minor
Found in src/Pug/Engine/Keywords.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 assigning values to variables in if clauses and the like (line '204', column '13').
Open

    public function renderWithJs($input, $filename, $vars = null, $fallback = null)
    {
        if (is_array($filename)) {
            if (!is_null($vars)) {
                $fallback = $vars;
Severity: Minor
Found in src/Pug/Engine/PugJsEngine.php by phpmd

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid unused parameters such as '$compiler'.
Open

    public function __invoke(Filter $node, Compiler $compiler)
Severity: Minor
Found in src/Pug/Filter/AbstractFilter.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

Avoid using static access to class '\Phug\Phug' in method 'extractExtensionsFromKeywords'.
Open

                    $options = array_merge($options, Phug::getExtensionsOptions([$keyword->getExtension()]));
Severity: Minor
Found in src/Pug/Engine/Options.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 '$node'.
Open

    public function __invoke(Filter $node, Compiler $compiler)
Severity: Minor
Found in src/Pug/Filter/AbstractFilter.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

Line exceeds 120 characters; contains 141 characters
Open

        if (!$this->getOption('strict') && strpos($input, "\n") === false && file_exists($input) && !is_dir($input) && is_readable($input)) {
Severity: Minor
Found in src/Pug/Engine/Renderer.php by phpcodesniffer

Line exceeds 120 characters; contains 123 characters
Open

            'cacheFolderIsWritable' => !$this->getDefaultOption('cache_dir') || is_writable($this->getOption('cache_dir')),
Severity: Minor
Found in src/Pug/Pug.php by phpcodesniffer

Line exceeds 120 characters; contains 150 characters
Open

                throw new InvalidArgumentException($name . ' is not in the requirements list (' . implode(', ', array_keys($requirements)) . ')', 19);
Severity: Minor
Found in src/Pug/Pug.php by phpcodesniffer

Line exceeds 120 characters; contains 127 characters
Open

        throw new \RuntimeException('Pug\Filter\FilterInterface is no longer supported. Now use Pug\FilterInterface instead.');

Expected 0 spaces before closing bracket; newline found
Open

            $this->nodeEngine = new NodejsPhpFallback($this->hasOption('node_path')

Opening parenthesis of a multi-line function call must be the last content on the line
Open

        file_put_contents($renderFile,

Expected 0 spaces after opening bracket; newline found
Open

            if (
Severity: Minor
Found in example/bootstrap.php by phpcodesniffer

Expected 0 spaces before closing bracket; newline found
Open

        file_put_contents($optionsFile, 'module.exports = require(' .

Class extends undeclared class \Phug\Compiler (Did you mean class \Jade\Compiler or class \Pug\Compiler)
Open

class Compiler extends \Phug\Compiler
Severity: Critical
Found in src/Pug/Compiler.php by phan

Class extends undeclared class \Phug\Renderer (Did you mean class \Pug\Engine\Renderer)
Open

abstract class Filters extends Renderer
Severity: Critical
Found in src/Pug/Engine/Filters.php by phan

Call to method getExtensionsOptions from undeclared class \Phug\Phug
Open

                    $options = array_merge($options, Phug::getExtensionsOptions([$keyword->getExtension()]));
Severity: Critical
Found in src/Pug/Engine/Options.php by phan
Severity
Category
Status
Source
Language