Showing 112 of 112 total issues

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

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 assigning values to variables in if clauses and the like (line '206', 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 '$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 '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 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 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 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 '\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

Line exceeds 120 characters; contains 127 characters
Open

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

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 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

Expected 0 spaces after opening bracket; newline found
Open

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

Call to undeclared method \Pug\Engine\Filters::getCompiler
Open

        return $this->getCompiler()->hasFilter($name);
Severity: Critical
Found in src/Pug/Engine/Filters.php by phan

Call to undeclared method \Pug\Engine\Filters::getCompiler
Open

        $filter = $this->getCompiler()->getFilter($name);
Severity: Critical
Found in src/Pug/Engine/Filters.php by phan

Call to method __construct from undeclared class \JsPhpize\JsPhpizePhug
Open

            $compiler->addModule(new JsPhpizePhug($compiler));
Severity: Critical
Found in src/Pug/Engine/Options.php by phan

Argument 1 (extension) is \Phug\JsTransformerExtension but \Pug\Engine\Options::addExtension() takes \Phug\ExtensionInterface defined at /code/src/Pug/Engine/Keywords.php:42
Open

        $this->addExtension(new JsTransformerExtension());
Severity: Minor
Found in src/Pug/Engine/Options.php by phan

Return type of getNodeEngine() is undeclared type \NodejsPhpFallback\NodejsPhpFallback
Open

    public function getNodeEngine()
Severity: Minor
Found in src/Pug/Engine/PugJsEngine.php by phan

Call to method execModuleScript from undeclared class \NodejsPhpFallback\NodejsPhpFallback
Open

        $result = $node->execModuleScript(
Severity: Critical
Found in src/Pug/Engine/PugJsEngine.php by phan
Severity
Category
Status
Source
Language