Showing 11 of 35 total issues
Function seq
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function seq(empty, size) {
const Seq = function (tree) {
this.tree = tree;
};
Function seq
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
export function seq(empty, size) {
const Seq = function (tree) {
this.tree = tree;
};
- 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 intervaltree
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function intervaltree(empty, M) {
const atleast = function (k, [_, n]) {
return k <= n;
};
Function indordseq
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function indordseq(empty, key, size, measure) {
// Probably needs a total order instead of a measure
// this causes generality problems in the insert, merge, partition and delete
// methods
Function ordseq
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ordseq(empty, key) {
// Probably needs a total order instead of a key measure
// this causes generality problems in the insert, merge, partition and delete
// methods
Function splice
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Seq.prototype.splice = function (start, deleteCount, ...items) {
const length = this.len();
if (start < -length || start >= length)
throw new Error(`wrong start '${start}'`);
Function intervaltree
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function intervaltree(empty, M) {
const atleast = function (k, [_, n]) {
return k <= n;
};
- 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 heap
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function heap(empty, max) {
const Heap = function (tree) {
this.tree = tree;
};
Function indordseq
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function indordseq(empty, key, size, measure) {
// Probably needs a total order instead of a measure
// this causes generality problems in the insert, merge, partition and delete
// methods
- 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
Avoid too many return
statements within this function. Open
return [new Seq(prefix.append(items).concat(suffix)), new Seq(deleted)];
Avoid too many return
statements within this function. Open
return [new Seq(prefix.append(items)), new Seq(rest)];