Showing 113 of 115 total issues
Method getNodeName
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getNodeName(NodeInterface $node)
{
switch (get_class($node)) {
case ElementNode::class:
$text = get_class($node);
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'),
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 provideAttributesAssignment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function provideAttributesAssignment()
{
return $this
->registerHelper(
'attributes_mapping',
Function scan
has a Cognitive Complexity of 14 (exceeds 7 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
Function displayFile
has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring. Open
public function displayFile($__pug_file, array $__pug_parameters = [])
{
if ($this->isExpired($__pug_file, $__pug_cache_file)) {
if (isset($this->options['render'])) {
call_user_func($this->options['render'], $__pug_file, $__pug_parameters, $this->options);
- 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 7 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
Method setFormatter
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setFormatter(Formatter $formatter)
{
$this->formatter = $formatter;
$format = $this;
Method formatElementChildren
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatElementChildren(ElementInterface $element, $indentStep = 1)
{
$indentLevel = $this->formatter->getLevel();
$this->formatter->setLevel($indentLevel + $indentStep);
$content = '';
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 compileNode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
{
$compiler = $this->getCompiler();
$compiler->assert(
$node instanceof FilterNode,
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 compileNode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
{
$compiler = $this->getCompiler();
$compiler->assert(
$node instanceof ElementNode,
Method readString
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readString(array $escapeSequences = null, $raw = false)
{
if (!$this->peekQuote()) {
return;
}
Function getNodeName
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
protected function getNodeName(NodeInterface $node)
{
switch (get_class($node)) {
case ElementNode::class:
$text = get_class($node);
- 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 findChildren
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
public function findChildren(callable $callback, $depth = null, $level = null)
{
$level = $level ?: 0;
foreach ($this->children as $child) {
- 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 hasNonStaticAttributes
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
protected function hasNonStaticAttributes(MarkupInterface $element)
{
if ($element instanceof MarkupElement || $element instanceof MixinCallElement) {
foreach ($element->getAttributes() as $attribute) {
if ($attribute->hasStaticMember('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 isInExclusionContext
has a Cognitive Complexity of 13 (exceeds 7 allowed). Consider refactoring. Open
private function isInExclusionContext(&$tokens, $index)
{
foreach ([
// Exclude tokens before the variables
-1 => [
- 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 __construct
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(Formatter $formatter = null)
{
parent::__construct($formatter);
$this
Method getEventListeners
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEventListeners()
{
$eventListeners = array_map(function (callable $eventListener) {
return function (Event $event) use ($eventListener) {
if ($this->isAlive() && $eventListener($event) !== false) {