File Parser.php
has 565 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Jade;
class Parser
Function tag
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
protected function tag($tag)
{
$tag->line = $this->line();
while (true) {
- 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
Parser
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Parser
{
public $basepath;
public $extension;
public $allowMixedIndent;
Method tag
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tag($tag)
{
$tag->line = $this->line();
while (true) {
Method parseInclude
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseInclude()
{
$token = $this->expect('include');
$file = trim($token->value);
$dir = realpath(dirname($this->filename));
Method parseBlock
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseBlock()
{
$block = $this->expect('block');
$mode = $block->mode;
$name = trim($block->value);
Method parseTextBlock
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseTextBlock()
{
$block = new Nodes\Block();
$block->line = $this->line();
$spaces = $this->expect('indent')->value;
Function parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function parse()
{
$block = new Nodes\Block();
$block->line = $this->line();
- 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 parseTextBlock
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseTextBlock()
{
$block = new Nodes\Block();
$block->line = $this->line();
$spaces = $this->expect('indent')->value;
- 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 parseInclude
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function parseInclude()
{
$token = $this->expect('include');
$file = trim($token->value);
$dir = realpath(dirname($this->filename));
- 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"