Showing 7 of 7 total issues
AbstractTuple
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractTuple implements LiteralTuple
{
/**
* @var string
Function unserializeContent
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function unserializeContent(Tuple $target, $content)
{
$offset = 0;
$key = null;
while ($offset < strlen($content)) {
- 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 unserializeContent
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function unserializeContent(Tuple $target, $content)
{
$offset = 0;
$key = null;
while ($offset < strlen($content)) {
Function findEndOfString
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function findEndOfString($string, $offset)
{
$quoted = $string[$offset] === $this->getStringDelimiter();
if ($quoted) {
- 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 foundNestedTuple
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function foundNestedTuple(Term $target, $content, $startsAt, $endsAt, $key, Term $nestedTarget = null)
Avoid too many return
statements within this method. Open
return strval($this->value);
Function unserialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function unserialize($string, Term $target = null)
{
$string = trim($string);
// Parse Literal terms.
- 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"