Function eraro
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Invalid
function eraro(options) {
options = options || {}
const msgprefix =
false === options.prefix
- 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 callpoint
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Invalid
function callpoint(error, markers) {
markers = Array.isArray(markers) ? markers : []
const stack = error ? error.stack : null
let out = ''
- 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 eraro
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
function eraro(options) {
options = options || {}
const msgprefix =
false === options.prefix
Function errormaker
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Invalid
const errormaker = function (ex, code, msg, details) {
if (Util.isError(ex)) {
if (ex.eraro && !options.override) {
return ex
}
Function buildmessage
has 8 arguments (exceeds 4 allowed). Consider refactoring. Invalid
options,
msg,
msgmap,
msgprefix,
_inspect,
Avoid deeply nested control flow statements. Invalid
if (found) break
Function buildmessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Invalid
function buildmessage(
options,
msg,
msgmap,
msgprefix,
- 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"