src/intern.ts
Function listents
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
Open
static listents(seneca: any, entmap: any, qent: any, q: any, done: any) {
let list = []
let canon = qent.canon$({ object: true })
let base = canon.base
- 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
Consider simplifying this complex logical expression. Open
Open
if (
(null != qv.$ne && qv.$ne == ev) ||
(null != qv.$gte && qv.$gte > ev) ||
(null != qv.$gt && qv.$gt >= ev) ||
(null != qv.$lt && qv.$lt <= ev) ||
Function listents
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static listents(seneca: any, entmap: any, qent: any, q: any, done: any) {
let list = []
let canon = qent.canon$({ object: true })
let base = canon.base
Function find_mement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
static find_mement(entmap: any, base_ent: any, filter: any): any {
const { base, name } = base_ent.canon$({ object: true })
const entset = entmap[base] && entmap[base][name]
if (null == entset) {
- 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 deeply nested control flow statements. Open
Open
next_ent: for (let id of entids) {
ent = entset[id]
for (let p in q) {
let qv = q[p] // query val
let ev = ent[p] // ent val