MartanLV/koki

View on GitHub

Showing 40 of 40 total issues

Function yieldInterSelect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

public function yieldInterSelect(int $low, int $high)
{
$edgeR = $high >= $this->interval->getStart() && $high <= $this->interval->getEnd();
$edgeL = $low >= $this->interval->getStart() && $low <= $this->interval->getEnd();
$part = $this->interval->getStart() >= $low && $this->interval->getEnd() <= $high;
Severity: Minor
Found in src/Node.php - About 25 mins to fix

The method add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->left = new self($i);
$this->left->root = &$this;
}
Severity: Minor
Found in src/Node.php by phpmd

The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->max = $i->getEnd();
if ($this->right) {
$this->right->add($i);
} else {
Severity: Minor
Found in src/Node.php by phpmd

The method add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->max = $i->getEnd();
if ($this->right) {
$this->right->add($i);
} else {
Severity: Minor
Found in src/Node.php by phpmd

The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->left = new Node($i);
}
Severity: Minor
Found in src/Tree.php by phpmd

The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->right = new self($i);
}
Severity: Minor
Found in src/Node.php by phpmd

The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->left = new self($i);
}
Severity: Minor
Found in src/Node.php by phpmd

The method add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->right = new self($i);
$this->right->root = &$this;
}
Severity: Minor
Found in src/Node.php by phpmd

The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->max = $i->getEnd();
if ($this->right) {
$this->right->add($i);
} else {
Severity: Minor
Found in src/Tree.php by phpmd

The method remove() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
Open

public function remove(IntervalInterface $i)
{
if (!$i->left && !$i->right) {
if ($i->root) {
$i->root = null;
Severity: Minor
Found in src/Tree.php by phpmd

The method remove uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$this->right = new Node($i);
}
Severity: Minor
Found in src/Tree.php by phpmd

The method yieldInterSelect() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
Open

public function yieldInterSelect(int $low, int $high)
{
$edgeR = $high >= $this->interval->getStart() && $high <= $this->interval->getEnd();
$edgeL = $low >= $this->interval->getStart() && $low <= $this->interval->getEnd();
$part = $this->interval->getStart() >= $low && $this->interval->getEnd() <= $high;
Severity: Minor
Found in src/Node.php by phpmd

The method remove() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Open

public function remove(IntervalInterface $i)
{
if (!$i->left && !$i->right) {
if ($i->root) {
$i->root = null;
Severity: Minor
Found in src/Tree.php by phpmd

The method yieldInterSelectNode() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
Open

public function yieldInterSelectNode(int $low, int $high)
{
$edgeR = $high >= $this->interval->getStart() && $high <= $this->interval->getEnd();
$edgeL = $low >= $this->interval->getStart() && $low <= $this->interval->getEnd();
$part = $this->interval->getStart() >= $low && $this->interval->getEnd() <= $high;
Severity: Minor
Found in src/Node.php by phpmd

The variable $l_intervals is not named in camelCase.
Open

public function toTree(array $intervals)
{
$max = 0;
$len = count($intervals);
$mid = (int) floor($len / 2);
Severity: Minor
Found in src/Tree.php by phpmd

The variable $l_intervals is not named in camelCase.
Open

public function toTree(array $intervals)
{
$max = 0;
$len = count($intervals);
$mid = (int) floor($len / 2);
Severity: Minor
Found in src/Tree.php by phpmd

The variable $r_intervals is not named in camelCase.
Open

public function toTree(array $intervals)
{
$max = 0;
$len = count($intervals);
$mid = (int) floor($len / 2);
Severity: Minor
Found in src/Tree.php by phpmd

The variable $l_intervals is not named in camelCase.
Open

public function toTree(array $intervals)
{
$max = 0;
$len = count($intervals);
$mid = (int) floor($len / 2);
Severity: Minor
Found in src/Tree.php by phpmd

The variable $r_intervals is not named in camelCase.
Open

public function toTree(array $intervals)
{
$max = 0;
$len = count($intervals);
$mid = (int) floor($len / 2);
Severity: Minor
Found in src/Tree.php by phpmd

The variable $r_intervals is not named in camelCase.
Open

public function toTree(array $intervals)
{
$max = 0;
$len = count($intervals);
$mid = (int) floor($len / 2);
Severity: Minor
Found in src/Tree.php by phpmd
Severity
Category
Status
Source
Language