Showing 44 of 46 total issues
Method build
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function build($dir, $sortClasses = false, $sortNs = false, $sortMethods = false, $noParents = false, $noMethods = false, $noNs = false)
Function parseInterface
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function parseInterface()
{
$extends = array();
$token = $this->tokenizer->expectToken(T_INTERFACE, false, true);
$name = $this->classResolver->resolve($this->parseIdentifier());
- 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 getAugmentedGrammar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getAugmentedGrammar()
{
if (!$this->isAugmentedGrammar()) {
if ($this->axiom) {
$axiom = new Rule(new NonTerminalSymbol('axiom'), array($this->axiom->getLeftHand()), 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 scan
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function scan(ReaderInterface $reader)
{
$this->debugSection("SCANNER CYCLE");
$this->resetQueue();
- 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(ReaderInterface $reader)
{
$tokens = array();
$curLine = 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 resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($name)
{
$search = $name;
if (($pos = strpos($name, '\\')) !== false) {
$search = substr($name, 0, $pos);
- 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 expectToken
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function expectToken($data, $optional = false, $compareType = false)
{
if (!$optional) {
$token = $this->getToken();
- 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 dump
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function dump($compact = false, $level = 0)
{
$dump = '';
$indent = str_repeat(' ', $level);
$dump .= sprintf("%sNODE[%s]%s\n", $indent, $this->type, !empty($this->properties) || !empty($this->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"
Further reading
Function find
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function find($dirName, $pattern = '*.php', $excludeDirs = array())
{
if (!is_dir($dirName)) {
throw new \InvalidArgumentException("Invalid directory '$dirName'");
}
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($file = '', $line = 0, $name = '', $extends = array(), $methods = array())
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($file = '', $line = 0, $name = '', $extends = '', $implements = array())
Method addClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addClass($file, $line, $name, $extends = array(), $implements = array())
Function peekToken
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function peekToken()
{
if ($this->isEof()) {
return 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 testGetNextChar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function testGetNextChar()
{
$curLine = 1;
$curCol = 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
Function parseUse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function parseUse()
{
$this->tokenizer->expectToken(T_USE, false, true);
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
Avoid too many return
statements within this method. Open
case self::TK_SYMBOL: return 'Symbol';
Avoid too many return
statements within this method. Open
case self::TK_IDENTIFIER: return 'Identifier';
Avoid too many return
statements within this method. Open
return $name;
Avoid too many return
statements within this method. Open
return $this->curNamespace . '\\' . $name;
Avoid too many return
statements within this method. Open
return 'Unknown';