Showing 121 of 129 total issues
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return original.apply(this, arguments)
Avoid too many return
statements within this function. Open
return s
Avoid too many return
statements within this function. Open
return segments.join('/')
Avoid too many return
statements within this function. Open
return pkgPath
Avoid too many return
statements within this function. Open
return this.logger('Failed to send event as transporter isnt available')
Avoid too many return
statements within this function. Open
return action.handler(data.opts || {}, stream)
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
return (plugin.getMakeRequestTraceFunction(request, options, plugin))(
span)
Avoid too many return
statements within this function. Open
return this.logger(`Received scoped action ${action.name} but without uuid`)
Avoid too many return
statements within this function. Open
if (one[i].labels && !two[i].labels) return false
Avoid too many return
statements within this function. Open
if (j === 0) return segments.join('/')
Function init
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
init (config?: NetworkTrafficConfig | boolean) {
if (config === false) return
if (config === true) {
config = allEnabled
}
- 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 convertTraceStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static convertTraceStatus (statusCode: number): number {
if (statusCode < 200 || statusCode > 504) {
return TraceStatusCodes.UNKNOWN
} else if (statusCode >= 200 && statusCode < 400) {
return TraceStatusCodes.OK
- 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 onUncaughtException
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private onUncaughtException (error) {
if (semver.satisfies(process.version, '< 6')) {
console.error(error.stack)
} else {
console.error(error)
- 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 patchEnd
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
patchEnd (span: Span, resultHandler: Function): Function {
const plugin = this
const patchedEnd = function (err?: Error) {
if (plugin.options.detailedCommands === true && err instanceof Error) {
span.addAttribute('error', err.message)
- 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 registerAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerAction (actionName?: string, opts?: Object | undefined | Function, handler?: Function): void {
if (typeof opts === 'function') {
handler = opts
opts = undefined
}
- 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 init
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
init (options?: Object) {
if (typeof options !== 'object') options = {}
this.logger('init')
for (let availableMetric of availableMetrics) {
- 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 aggregate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
aggregate (packet) {
if (this.validateData(packet) === false) return false
// Get http path of current span
let path = packet.spans[0].labels['http/path']
- 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 _cast
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private _cast (s) {
let key
// Don't cast Date objects
if (s instanceof Date) return s
- 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"