Showing 21 of 31 total issues
Function jsonic_strify
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
function jsonic_strify(val: any, opts: any, depth: number) {
depth++
if (null == val) return 'null'
var type = Object.prototype.toString.call(val).charAt(8)
- 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 canon$
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
canon$(opt?: any) {
const self = this
const canon = self.private$.canon
- 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 data$
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
data$(data?: any, canonkind?: any) {
const self: any = this
let val
// TODO: test for entity$ consistent?
- 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 make$
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
make$(...args: any[]) {
const self = this
let first = args[0]
let last = args[args.length - 1]
let promise = self.private$.promise
- 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 make$
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
make$(...args: any[]) {
const self = this
let first = args[0]
let last = args[args.length - 1]
let promise = self.private$.promise
Function normalize_query
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function normalize_query(qin: any, ent: any, flags?: { inject_id: boolean }) {
let q = qin
let inject_id = flags ? (false === flags.inject_id ? false : true) : 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
Function jsonic_strify
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function jsonic_strify(val: any, opts: any, depth: number) {
depth++
if (null == val) return 'null'
var type = Object.prototype.toString.call(val).charAt(8)
Function data$
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
data$(data?: any, canonkind?: any) {
const self: any = this
let val
// TODO: test for entity$ consistent?
Function parsecanon
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function parsecanon(str: CanonSpec) {
let out: any = {}
if (Array.isArray(str)) {
return {
- 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 MakeEntity
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MakeEntity(canon: any, seneca: any, opts: any): Entity {
opts = handle_options(opts, seneca)
const deep = seneca.util.deep
Function canon$
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
canon$(opt?: any) {
const self = this
const canon = self.private$.canon
Function handle_options
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handle_options(entopts: any, seneca: any): any {
entopts = entopts || Object.create(null)
let Jsonic = seneca.util.Jsonic
if (entopts.hide) {
Avoid deeply nested control flow statements. Open
if (null != str) {
out.push(str)
}
Function MakeEntity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function MakeEntity(canon: any, seneca: any, opts: any): Entity {
opts = handle_options(opts, seneca)
const deep = seneca.util.deep
- 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 is$
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
is$(canonspec: any) {
const self = this
const canon = canonspec
? canonspec.entity$
- 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 remove$
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
remove$(query: any, done?: any) {
const self = this
if ('function' === typeof query) {
done = query
- 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 load$
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
load$(query: any, done?: any) {
const self = this
if ('function' === typeof query) {
done = query
- 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 isNaN(val) ? 'null' : val.toString()
Avoid too many return
statements within this function. Open
return '{' + out.join(',') + '}'
Avoid too many return
statements within this function. Open
return '[' + out.join(',') + ']'