pug-php/js-phpize

View on GitHub
src/JsPhpize/Lexer/Scanner.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

The class Scanner has 11 public methods. Consider refactoring Scanner to keep number of public methods under 10.
Open

class Scanner
{
    public function scanUnexpected($matches)
    {
        throw $this->unexpected($this->valueToken('token', $matches));
Severity: Minor
Found in src/JsPhpize/Lexer/Scanner.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('newline', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::typeToken
Open

        return $this->typeToken($matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('variable', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('regexp', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('keyword', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('number', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::unexpected
Open

        throw $this->unexpected($this->valueToken('token', $matches));
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::exceptionInfos
Open

            throw new Exception('Constants cannot start with ' . $constPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 1);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::token
Open

        return $this->token('constant', $constant);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Reference to undeclared property \JsPhpize\Lexer\Scanner->engine
Open

        $constPrefix = $this->engine->getOption('constPrefix', JsPhpize::CONST_PREFIX);
Severity: Minor
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::consume
Open

        $this->consume($matches[0]);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::exceptionInfos
Open

            throw new Exception('Variables cannot start with ' . $varPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 4);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('lambda', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('string', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Reference to undeclared property \JsPhpize\Lexer\Scanner->engine
Open

        $varPrefix = $this->engine->getOption('varPrefix', JsPhpize::VAR_PREFIX);
Severity: Minor
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        throw $this->unexpected($this->valueToken('token', $matches));
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Call to undeclared method \JsPhpize\Lexer\Scanner::valueToken
Open

        return $this->valueToken('comment', $matches);
Severity: Critical
Found in src/JsPhpize/Lexer/Scanner.php by phan

Reference to undeclared property \JsPhpize\Lexer\Scanner->engine
Open

        if ($this->engine->getOption('ignoreDollarVariable') && mb_substr($matches[0], 0, 1) === '$') {
Severity: Minor
Found in src/JsPhpize/Lexer/Scanner.php by phan

Line exceeds 120 characters; contains 151 characters
Open

            throw new Exception('Constants cannot start with ' . $constPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 1);

Line exceeds 120 characters; contains 149 characters
Open

            throw new Exception('Variables cannot start with ' . $varPrefix . ', this prefix is reserved for JsPhpize' . $this->exceptionInfos(), 4);

There are no issues that match your filters.

Category
Status