Showing 10 of 10 total issues
Method __construct
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($overwrites = [])
{
/** @noinspection PhpUndefinedMethodInspection */
$abnf = new Rfc2234();
Method __construct
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($overwrites = [])
{
$abnf = new Rfc4234();
$ipv6 = new Rfc3513();
Method __construct
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($overwrites = [])
{
/*
* Support rules.
* These are not part of the published specification, but help make the published rules more manageable without
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($group, $name, $input, int $offset, $length, $children = [], $class = null)
Function parse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function parse(&$input, $offset, Context $context)
{
$childMatches = [];
$this->pushSpacer($context);
- 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 makeMatch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function makeMatch($success, &$input, $offset, $length = 0, &$successes = [])
Method resolveToken
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function resolveToken($input, $offset, $length, &$children, $class)
Avoid too many return
statements within this method. Open
return parent::__get($name);
Function build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function build()
{
if ($this->parser === null) {
$this->parser = $this->definition->generator;
if (!$this->parser instanceof Parser) {
- 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 validateResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function validateResults(AbstractMatch $match, $text)
{
$results = [];
if ($match instanceof Success) {
$results = $match->results;
- 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"