Showing 71 of 107 total issues
Function MergeRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function MergeRecursive(obj1, obj2) {
for (var p in obj2) {
try {
if (obj2[p].constructor === Object) {
obj1[p] = MergeRecursive(obj1[p], obj2[p]);
- 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 _sendToAll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _sendToAll (params: IServDiscMwParam, next, done, xyz:XYZ) {
let servicePath = params.opt.servicePath
let userPayload = params.opt.payload
let responseCallback = params.responseCallback
let route = params.opt.route
- 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 MergeRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function MergeRecursive (obj1, obj2) {
for (let p in obj2) {
try {
if (obj2[p].constructor === Object) {
obj1[p] = MergeRecursive(obj1[p], obj2[p])
- 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 Util_1.wrapper('red', level);
Avoid too many return
statements within this function. Open
return Util_1.wrapper('yellow', level);
Avoid too many return
statements within this function. Open
return wrapper('yellow', level)
Avoid too many return
statements within this function. Open
return wrapper('red', level)
Function _findTargetPort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_findTargetPort (route, node) {
let foreignRoutes = this.xyz.serviceRepository.foreignRoutes[node]
for (let p in foreignRoutes) {
for (let r of foreignRoutes[p]) {
if (r === route) {
- 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 levelColor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function levelColor (level) {
if (level === 'silly') {
return wrapper('magenta', level)
}
if (level === 'debug') {
- 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 _checkUniqueRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_checkUniqueRoute (prefix) {
for (let s in this.servers) {
for (let r in this.servers[s].routes) {
if (r === prefix) {
return false
- 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 levelColor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function levelColor(level) {
if (level === 'silly') {
return Util_1.wrapper('magenta', level);
}
if (level === 'debug') {
- 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"