Function tokenizeString
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
public function tokenizeString(string $inputString): array
{
$inputString = $this->preprocessor->preprocess($inputString);
$tokens = new TokenStreamBuilder();
File Tokenizer.php
has 255 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
declare(strict_types=1);
namespace Helmich\TypoScriptParser\Tokenizer;
Method tokenizeBinaryObjectOperation
has 49 lines of code (exceeds 25 allowed). Consider refactoring.
private function tokenizeBinaryObjectOperation(TokenStreamBuilder $tokens, array $matches, int $currentLine): void
{
$tokens->append(
$this->getTokenTypeForBinaryOperator($matches[3]),
$matches[3],
Method tokenizeString
has 45 lines of code (exceeds 25 allowed). Consider refactoring.
public function tokenizeString(string $inputString): array
{
$inputString = $this->preprocessor->preprocess($inputString);
$tokens = new TokenStreamBuilder();
Function tokenizeBinaryObjectOperation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
private function tokenizeBinaryObjectOperation(TokenStreamBuilder $tokens, array $matches, int $currentLine): void
{
$tokens->append(
$this->getTokenTypeForBinaryOperator($matches[3]),
$matches[3],
Function tokenizeObjectOperation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
private function tokenizeObjectOperation(
TokenStreamBuilder $tokens,
MultilineTokenBuilder $state,
ScannerLine $line
): bool {
Avoid too many return
statements within this method.
return TokenInterface::TYPE_OPERATOR_DELETE;
Avoid too many return
statements within this method.
return;
The method tokenizeString() has an NPath complexity of 258. The configured NPath complexity threshold is 200.
public function tokenizeString(string $inputString): array
{
$inputString = $this->preprocessor->preprocess($inputString);
$tokens = new TokenStreamBuilder();
The method tokenizeBinaryObjectOperation() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
private function tokenizeBinaryObjectOperation(TokenStreamBuilder $tokens, array $matches, int $currentLine): void
{
$tokens->append(
$this->getTokenTypeForBinaryOperator($matches[3]),
$matches[3],
The method tokenizeBinaryObjectOperation() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
private function tokenizeBinaryObjectOperation(TokenStreamBuilder $tokens, array $matches, int $currentLine): void
{
$tokens->append(
$this->getTokenTypeForBinaryOperator($matches[3]),
$matches[3],
The method tokenizeString() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
public function tokenizeString(string $inputString): array
{
$inputString = $this->preprocessor->preprocess($inputString);
$tokens = new TokenStreamBuilder();
The class Tokenizer has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
class Tokenizer implements TokenizerInterface
{
const OBJECT_ACCESSOR = '((?:\.)|(?:[a-zA-Z0-9_\-\\\\:\$\{\}/]+(?:\.[a-zA-Z0-9_\-\\\\:\$\{\}/]*)*))';
const TOKEN_WHITESPACE = ',^[ \t\n]+,s';
Missing class import via use statement (line '143', column '23').
throw new \InvalidArgumentException("could not open file '$inputStream'");
Avoid assigning values to variables in if clauses and the like (line '273', column '14').
private function tokenizeMultilineComment(
TokenStreamBuilder $tokens,
MultilineTokenBuilder $state,
ScannerLine $line
): void {
Avoid assigning values to variables in if clauses and the like (line '323', column '14').
private function tokenizeObjectOperation(
TokenStreamBuilder $tokens,
MultilineTokenBuilder $state,
ScannerLine $line
): bool {
Avoid assigning values to variables in if clauses and the like (line '309', column '18').
private function tokenizeSimpleStatements(TokenStreamBuilder $tokens, ScannerLine $line): bool
{
$simpleTokens = [
self::TOKEN_COMMENT_ONELINE => TokenInterface::TYPE_COMMENT_ONELINE,
self::TOKEN_NESTING_END => TokenInterface::TYPE_BRACE_CLOSE,
Avoid assigning values to variables in if clauses and the like (line '101', column '18').
public function tokenizeString(string $inputString): array
{
$inputString = $this->preprocessor->preprocess($inputString);
$tokens = new TokenStreamBuilder();
Avoid assigning values to variables in if clauses and the like (line '269', column '14').
private function tokenizeMultilineComment(
TokenStreamBuilder $tokens,
MultilineTokenBuilder $state,
ScannerLine $line
): void {
Expected 0 spaces after opening bracket; newline found
if (
There are no issues that match your filters.