Showing 107 of 107 total issues
Avoid too many return
statements within this function. Open
return wrapper('yellow', 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('red', level)
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"
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 _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"