File _debugger.js
has 1185 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
Function setBreakpoint
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Interface.prototype.setBreakpoint = function(script, line,
condition, silent) {
if (!this.requireConnection()) return;
var self = this,
- 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 setBreakpoint
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype.setBreakpoint = function(script, line,
condition, silent) {
if (!this.requireConnection()) return;
var self = this,
Function Interface
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Interface(stdin, stdout, args) {
var self = this;
this.stdin = stdin;
this.stdout = stdout;
Function trySpawn
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype.trySpawn = function(cb) {
var self = this,
breakpoints = this.breakpoints || [],
port = exports.port,
host = 'localhost',
Function mirrorObject
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Client.prototype.mirrorObject = function(handle, depth, cb) {
var self = this;
var val;
Function trySpawn
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Interface.prototype.trySpawn = function(cb) {
var self = this,
breakpoints = this.breakpoints || [],
port = exports.port,
host = 'localhost',
- 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 Interface
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function Interface(stdin, stdout, args) {
var self = this;
this.stdin = stdin;
this.stdout = stdout;
- 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 list
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype.list = function(delta) {
if (!this.requireConnection()) return;
delta || (delta = 5);
Function _onResponse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Client.prototype._onResponse = function(res) {
var cb,
index = -1;
this._reqCallbacks.some(function(fn, i) {
- 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 scripts
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Interface.prototype.scripts = function() {
if (!this.requireConnection()) return;
var client = this.client,
displayNatives = arguments[0] || 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 execute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Protocol.prototype.execute = function(d) {
var res = this.res;
res.raw += d;
switch (this.state) {
Function _onResponse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Client.prototype._onResponse = function(res) {
var cb,
index = -1;
this._reqCallbacks.some(function(fn, i) {
Function clearBreakpoint
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype.clearBreakpoint = function(script, line) {
if (!this.requireConnection()) return;
var ambiguous,
breakpoint,
Function execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Protocol.prototype.execute = function(d) {
var res = this.res;
res.raw += d;
switch (this.state) {
- 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
Consider simplifying this complex logical expression. Open
if (cb) {
this._reqCallbacks.splice(index, 1);
handled = true;
var err = res.success === false && (res.message || true) ||
Function backtrace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype.backtrace = function() {
if (!this.requireConnection()) return;
var self = this,
client = this.client;
Function watchers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Interface.prototype.watchers = function() {
var self = this,
verbose = arguments[0] || false,
callback = arguments[1] || function() {},
waiting = this._watchers.length,
Function watchers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Interface.prototype.watchers = function() {
var self = this,
verbose = arguments[0] || false,
callback = arguments[1] || function() {},
waiting = this._watchers.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 SourceInfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function SourceInfo(body) {
var result = body.exception ? 'exception in ' : 'break in ';
if (body.script) {
if (body.script.name) {
- 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 deeply nested control flow statements. Open
if (scriptId) {
ambiguous = true;
}
Function mirrorObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Client.prototype.mirrorObject = function(handle, depth, cb) {
var self = this;
var val;
- 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"