Showing 28 of 28 total issues
Function scan
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
if ($reader->match('(?<raw>\!)?#\{')) {
- Read upRead up
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
Function scan
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
foreach ($state->scanToken(
- Read upRead up
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
Function scan
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
//Text block on tags etc. (p. some text|p!. some text)
- Read upRead up
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
Method scan
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
foreach ($state->scanToken(
Method lex
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lex($input, $path = null)
{
$stateClassName = $this->getOption('lexer_state_class_name');
$lexEvent = new LexEvent($input, $path, $stateClassName, [
'encoding' => $this->getOption('encoding'),
Function scan
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
$tokens = [];
/** @var ImportToken $token */
- Read upRead up
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
Method getList
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getList()
{
return [
//TODO: Several of these are non-standard and need to be encapsulated into extensions
//Namely: ForScanner, DoScanner, VariableScanner
Method scan
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
if (!$reader->peekString('//')) {
Method __construct
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(Lexer $lexer, $input, array $options)
{
$this->lexer = $lexer;
$this->setOptionsRecursive([
'reader_class_name' => Reader::class,
Function scan
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
$keywords = $state->getOption('keyword_names');
if (count($keywords)) {
- Read upRead up
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
Function scanInterpolationTokens
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function scanInterpolationTokens(State $state, &$firstToken)
{
if (static::INTERPOLATION_ENABLED) {
foreach ($state->scan(InterpolationScanner::class) as $subToken) {
if ($firstToken) {
- Read upRead up
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
Method getIndentLevel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIndentLevel(State $state, $maxLevel = INF, callable $getIndentChar = null)
{
if ($maxLevel <= 0) {
return 0;
}
Function analyze
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function analyze($quitOnOutdent, array $breakChars = [])
{
$this->outdent = false;
$this->level = $this->state->getLevel();
$this->newLevel = $this->level;
- Read upRead up
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
Function getIndentLevel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getIndentLevel(State $state, $maxLevel = INF, callable $getIndentChar = null)
{
if ($maxLevel <= 0) {
return 0;
}
- Read upRead up
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
Function scan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
foreach ($state->scanToken(
BlockToken::class,
'block(?:[\t ]+(?<mode>append|prepend|replace))?'.
- Read upRead up
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
Function scan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
if (!$reader->peekChar('<')) {
- Read upRead up
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
Function loopScan
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function loopScan($scanners, $required = false)
{
if ($this->reader->hasLength() && $this->scanners === null) {
$this->scanners = $this->filterScanners($scanners);
}
- Read upRead up
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
Function yieldLines
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function yieldLines(State $state, array $lines, LineAnalyzer $analyzer)
{
yield $state->createToken(IndentToken::class);
$maxIndent = $analyzer->getMaxIndent();
- Read upRead up
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
Function scanParenthesesContent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function scanParenthesesContent(State $state, array $options)
{
$reader = $state->getReader();
while ($reader->hasLength()) {
- Read upRead up
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
Function scan
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function scan($scanners, array $options = [])
{
$scanners = $this->filterScanners($scanners);
foreach ($scanners as $scanner) {
- Read upRead up
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"