kylekatarnls/jade-php

View on GitHub

Showing 115 of 115 total issues

Method renderWithJs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
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 - About 1 hr to fix

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

                if ($this->getNamespaceOffsets($token, $afterNamespace, $start, $end)) {
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$afterNamespace' which will lead to PHP notices.
    Open

            foreach ($this->filterNamespaceStringTokens($tokens, $afterNamespace, $start, $end) as $token) {
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$end' which will lead to PHP notices.
    Open

                    return [$token[1], $start, $end];
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$start' which will lead to PHP notices.
    Open

            foreach ($this->filterNamespaceStringTokens($tokens, $afterNamespace, $start, $end) as $token) {
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$end' which will lead to PHP notices.
    Open

                if ($this->getNamespaceOffsets($token, $afterNamespace, $start, $end)) {
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$start' which will lead to PHP notices.
    Open

                    return [$token[1], $start, $end];
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$end' which will lead to PHP notices.
    Open

            foreach ($this->filterNamespaceStringTokens($tokens, $afterNamespace, $start, $end) as $token) {
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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 '$afterNamespace' which will lead to PHP notices.
    Open

                if ($this->getNamespaceOffsets($token, $afterNamespace, $start, $end)) {
    Severity: Minor
    Found in src/Pug/Engine/OptionsHandler.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

    A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 5.
    Open

    <?php
    Severity: Minor
    Found in example/bootstrap.php by phpcodesniffer

    Missing class import via use statement (line '23', column '19').
    Open

            throw new \RuntimeException('Pug\Filter\FilterInterface is no longer supported. Now use Pug\FilterInterface instead.');
    Severity: Minor
    Found in src/Pug/Filter/AbstractFilter.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '9', column '19').
    Open

            throw new \InvalidArgumentException(
    Severity: Minor
    Found in src/Jade/Filter/AbstractFilter.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '18', column '19').
    Open

            throw new \RuntimeException('->getNodeString is no longer supported since you get now contents as a string.');
    Severity: Minor
    Found in src/Pug/Filter/AbstractFilter.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '70', column '23').
    Open

                throw new \RuntimeException(
    Severity: Minor
    Found in src/Pug/Engine/PugJsEngine.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '9', column '19').
    Open

            throw new \InvalidArgumentException(
    Severity: Minor
    Found in src/Jade/Compiler.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '122', column '19').
    Open

            throw new \ErrorException(
    Severity: Minor
    Found in src/Pug/Pug.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '9', column '19').
    Open

            throw new \InvalidArgumentException(
    Severity: Minor
    Found in src/Jade/Parser.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '9', column '19').
    Open

            throw new \InvalidArgumentException(
    Severity: Minor
    Found in src/Jade/Jade.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Missing class import via use statement (line '9', column '19').
    Open

            throw new \InvalidArgumentException(
    Severity: Minor
    Found in src/Jade/Lexer.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

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

    Function extractExtensionsFromKeywords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function extractExtensionsFromKeywords(&$options)
        {
            if (isset($options['keywords'])) {
                foreach ($options['keywords'] as $keyword) {
                    if ($keyword instanceof ExtensionContainerInterface) {
    Severity: Minor
    Found in src/Pug/Engine/Options.php - About 25 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

    Severity
    Category
    Status
    Source
    Language