Showing 76 of 82 total issues
Function init
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
init (config?: RuntimeMetricsOptions | boolean) {
if (config === false) return
if (config === undefined) {
config = defaultOptions
}
File transactionAggregator.ts
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
import * as Debug from 'debug'
import { EventEmitter2 } from 'eventemitter2'
import EWMA from './EWMA'
Function matchPath
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
matchPath (path, routes) {
// empty route is / without the fist slash
if (!path || !routes) return false
if (path === '/') return routes[path] ? path : null
- 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 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
init (config?: EventLoopMetricOption | boolean) {
if (config === false) return
if (config === undefined) {
config = defaultOptions
}
Function init
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
init (config?: RuntimeMetricsOptions | boolean) {
if (config === false) return
if (config === undefined) {
config = defaultOptions
}
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
init (config?: V8MetricsConfig | boolean) {
if (config === false) return
if (config === undefined) {
config = defaultOptions
}
- 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 prepareAggregationforShipping
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareAggregationforShipping () {
let routes = this.cache.routes
const normalized: Trace = {
routes: [],
Function init
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
init (config?: EventLoopMetricOption | boolean) {
if (config === false) return
if (config === undefined) {
config = defaultOptions
}
- 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 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init (conf, doNotTellPm2?) {
const packageFilepath = Configuration.findPackageJson()
let packageJson
if (!conf.module_conf) {
Function init
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static init (conf, doNotTellPm2?) {
const packageFilepath = Configuration.findPackageJson()
let packageJson
if (!conf.module_conf) {
- 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
File inspectorProfiler.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ProfilerType } from '../features/profiling'
import Configuration from '../configuration'
import { ServiceManager } from '../serviceManager'
import { Transport } from '../services/transport'
Function _sink
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_sink (sinkIndex) {
const sinkElement = this._elements[sinkIndex]
const sinkScore = this._score(sinkElement)
const length = this._elements.length
- 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 metrics
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
metrics (metric: MetricBulk | Array<MetricBulk>): any[] {
const res: any[] = []
// tslint:disable-next-line
if (metric === undefined || metric === null) {
Function listener
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private listener (data) {
this.logger(`Received new message from reverse`)
if (!data) return false
const actionName = data.msg ? data.msg : data.action_name ? data.action_name : data
Function aggregate
has 45 lines of code (exceeds 25 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']
Function init
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
init (config?: IOConfig) {
const callsite = (new Error().stack || '').split('\n')[2]
if (callsite && callsite.length > 0) {
this.logger(`init from ${callsite}`)
}
Function init
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
init (): void {
this.transport = ServiceManager.get('transport')
if (this.transport === null) return this.logger('Failed to init metrics service cause no transporter')
this.logger('init')
- 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 listener
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private listener (data) {
this.logger(`Received new message from reverse`)
if (!data) return false
const actionName = data.msg ? data.msg : data.action_name ? data.action_name : data
- 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 compareList
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
compareList (one: any[], two: any[]) {
if (one.length !== two.length) return false
for (let i = 0; i < one.length; i++) {
if (one[i].name !== two[i].name) 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 registerAction
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerAction (actionName?: string, opts?: Object | undefined | Function, handler?: Function): void {
if (typeof opts === 'function') {
handler = opts
opts = undefined
}