src/profilers/addonProfiler.ts
Function init
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init () {
for (const moduleName of this.modules) {
let path = utils.detectModule(moduleName)
// continue to search if we dont find it
if (path === null) continue
Function onCPUProfileStop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private onCPUProfileStop (cb) {
if (this.currentProfile === null) {
return cb({
err: 'No profiling are already running',
success: false
Function onCPUProfileStart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private onCPUProfileStart (opts, cb) {
if (typeof cb !== 'function') {
cb = opts
opts = {}
}
Function onHeapdump
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private onHeapdump (opts, cb) {
if (typeof cb !== 'function') {
cb = opts
opts = {}
}
Function init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
init () {
for (const moduleName of this.modules) {
let path = utils.detectModule(moduleName)
// continue to search if we dont find it
if (path === null) continue
- 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 onCPUProfileStart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private onCPUProfileStart (opts, cb) {
if (typeof cb !== 'function') {
cb = opts
opts = {}
}
- 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"