Showing 61 of 69 total issues
File SubMap.php
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* chdemko\SortedCollection\SubMap class
*
Function remove
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function remove($key, $comparator)
{
$cmp = call_user_func($comparator, $key, $this->key);
if ($cmp < 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 find
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function find($key, $comparator, $type = 0)
{
$node = $this;
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
File TreeNode.php
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* chdemko\SortedCollection\TreeNode class
*
AbstractMap
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractMap implements SortedMap
{
/**
* Magic get method
*
SubMap
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SubMap extends AbstractMap
{
/**
* When the from or to key is unused
*
Function higher
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function higher($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Higher element unexisting');
}
- 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 floor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function floor($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Floor element unexisting');
}
- 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 lower
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function lower($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Lower element unexisting');
}
- 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 ceiling
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function ceiling($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Ceiling element unexisting');
}
- 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 insert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function insert($key, $value, $comparator)
{
$node = $this;
$cmp = call_user_func($comparator, $key, $this->key);
- 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 remove
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function remove($key, $comparator)
{
$cmp = call_user_func($comparator, $key, $this->key);
if ($cmp < 0) {
Function pullUpLeftMost
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function pullUpLeftMost()
{
if ($this->information & 2) {
$leftBalance = $this->left->information & ~3;
$this->left = $this->left->pullUpLeftMost();
- 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 jsonSerialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize(): array
{
if ($this->fromOption == self::UNUSED) {
if ($this->toOption == self::UNUSED) {
return array(
Method floor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function floor($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Floor element unexisting');
}
Method ceiling
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ceiling($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Ceiling element unexisting');
}
Method jsonSerialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize(): array
{
if (isset($this->from)) {
if (isset($this->to)) {
return array(
Method find
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function find($key, $comparator, $type = 0)
{
$node = $this;
while (true) {
Method lower
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lower($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Lower element unexisting');
}
Method higher
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function higher($key)
{
if ($this->empty) {
throw new \OutOfBoundsException('Higher element unexisting');
}