Showing 35 of 179 total issues
File Parser.php
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace JsPhpize\Parser;
use JsPhpize\JsPhpize;
Function appendFunctionsCalls
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected function appendFunctionsCalls(&$value, $previousToken = null, $applicant = null)
{
while ($token = $this->get(0)) {
if ($token->is('{') || $token->expectNoLeftMember()) {
throw $this->unexpected($this->next());
- 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 parseParentheses
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function parseParentheses($allowedSeparators = [',', ';'])
{
$parentheses = new Parenthesis();
$exceptionInfos = $this->exceptionInfos();
$expectComma = false;
- 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
File Compiler.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace JsPhpize\Compiler;
use JsPhpize\JsPhpize;
Function parseVariable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function parseVariable($name)
{
$children = [];
$variable = null;
- 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 appendFunctionsCalls
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function appendFunctionsCalls(&$value, $previousToken = null, $applicant = null)
{
while ($token = $this->get(0)) {
if ($token->is('{') || $token->expectNoLeftMember()) {
throw $this->unexpected($this->next());
Method render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($input, $filename = null, array $variables = [])
{
if (is_array($filename)) {
$variables = $filename;
$filename = null;
Method parseParentheses
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseParentheses($allowedSeparators = [',', ';'])
{
$parentheses = new Parenthesis();
$exceptionInfos = $this->exceptionInfos();
$expectComma = false;
Function parseHooksArray
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function parseHooksArray()
{
$array = new HooksArray();
$exceptionInfos = $this->exceptionInfos();
$expectComma = false;
- 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 parseBracketsArray
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function parseBracketsArray()
{
$array = new BracketsArray();
$exceptionInfos = $this->exceptionInfos();
$expectComma = false;
- 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 visitDyiade
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function visitDyiade(Dyiade $dyiade, $indent)
{
$leftHand = $this->visitNode($dyiade->leftHand, $indent);
$rightHand = $this->visitNode($dyiade->rightHand, $indent);
switch ($dyiade->operator) {
Method parseKeywordStatement
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseKeywordStatement($token)
{
$name = $token->value;
$keyword = new Block($name);
Method parseVariable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseVariable($name)
{
$children = [];
$variable = null;
Function visitDyiade
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function visitDyiade(Dyiade $dyiade, $indent)
{
$leftHand = $this->visitNode($dyiade->leftHand, $indent);
$rightHand = $this->visitNode($dyiade->rightHand, $indent);
switch ($dyiade->operator) {
- 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 parseInstruction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function parseInstruction($block, $token, &$initNext)
{
if ($token->type === 'keyword') {
if ($token->isIn('var', 'const')) {
$initNext = 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
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function render($input, $filename = null, array $variables = [])
{
if (is_array($filename)) {
$variables = $filename;
$filename = null;
- 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 visitFunctionCall
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function visitFunctionCall(FunctionCall $functionCall, $indent)
{
$function = $functionCall->function;
$arguments = $functionCall->arguments;
$applicant = $functionCall->applicant;
Method compile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compile($input, $filename = null)
{
$this->flags = 0;
if ($filename === null) {
Function getVariableChildFromToken
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getVariableChildFromToken(Token $token)
{
if ($token->is('.')) {
$this->skip();
$token = $this->next();
- 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 parseFunctionCallChildren
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseFunctionCallChildren($function, $applicant = null)
{
$arguments = $this->parseParentheses()->nodes;
$children = [];
- 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"