Showing 7 of 31 total issues
Function appendSuffix
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function appendSuffix(int $i)
{
// initialize phase state
$this->prev_int_node = null;
$this->suffixes_to_add++;
- 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 transferChildren
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function transferChildren(
NodeInterface $node,
array &$node_map = [],
array &$lazy_links = [],
int $path_size = 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
Method transferChildren
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function transferChildren(
NodeInterface $node,
array &$node_map = [],
array &$lazy_links = [],
int $path_size = 0
Method appendSuffix
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function appendSuffix(int $i)
{
// initialize phase state
$this->prev_int_node = null;
$this->suffixes_to_add++;
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(int $start, int $end, int $smin, int $smax, array $children = [], $suffix_link = null)
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render(SuffixTree $tree): string
{
$node_map = [];
$nodes = [];
- 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 dfsLongestRepetition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function dfsLongestRepetition(NodeInterface $node, int $path_size, array $slice, $overlap = false): array
{
if ($node instanceof LeafNode && $slice[1] < $path_size - $node->getEdgeSize()) {
$slice = [ $node->getSuffixIdx(), $path_size - $node->getEdgeSize() ];
} else {
- 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"