Showing 70 of 839 total issues
Function injectScope
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function injectScope($parent_scope)
{
if (!$this->is_explicit) {
// Check if there is an implicit label
$label = $parent_scope->getMetaInContext(Meta::M_LABEL);
- 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 format
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function format(Parser $parser)
{
$source = '&';
switch (count($this->parameters)) {
Method bundle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bundle($config)
{
// Configuration
$bundle = $config['bundle'];
$resources = $config['resources'];
Function readFiles
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function readFiles()
{
$abstractions = [];
$classes = [];
$handle = opendir($this->path);
- 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 nextToken
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function nextToken()
{
while ($this->peek != self::EOF) {
if (ctype_digit($this->peek)) {
return $this->digit();
Method _stmt
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _stmt()
{
$stmt_list = [
Tag::T_IF => '_ifStmt',
Tag::T_LET => '_letStmt',
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($input)
{
$this->size = strlen($input);
if ($this->size === 0) {
Method parse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse($grammar, Token $token)
{
$parameters = [];
$kind = null;
$body = null;
Method injectScope
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function injectScope($parent_scope)
{
$this->scope = $parent_scope;
$this->left->injectScope($parent_scope);
Method handleListDefinitions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleListDefinitions()
{
$renderer = new CliColorizer();
$context = $this->state('scope')->child;
Method regex
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function regex()
{
$buffer = [];
$buffer[] = $this->readChar();
$buffer[] = $this->readChar();
Method render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$line = implode('', $this->state('line'));
$column = $this->state('column');
Method getPartialOperators
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function & getPartialOperators()
{
static $op_table = [
'+',
'-',
Method format
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function format(Parser $parser)
{
$first = true;
$size = count($this->clauses);
$processed = 0;
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(Tokenizer $input)
{
parent::__construct($input);
$name_parser = new NameParser($this);
$type_parser = new TypeParser($this);
Function format
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function format(Parser $parser)
{
$source = '&';
switch (count($this->parameters)) {
- 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 getType
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getType()
{
$left_type = $this->left->getType();
$index_type = $this->index->getType();
- 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 compile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function compile($source, $silent = false)
{
if ('' === $source) {
$this->resetState();
return;
- 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 regex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function regex()
{
$buffer = [];
$buffer[] = $this->readChar();
$buffer[] = $this->readChar();
- 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 check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function check(TypeNode $other)
{
if (!($other instanceof MapType)) {
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"