Showing 17 of 24 total issues
Function exports
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (options) {
this.name = function(elt, host) {
var keys, name, n;
- 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 exports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (options) {
this.name = function(elt, host) {
var keys, name, n;
Function check
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
SshCheck.prototype.check = function(host, data, callback) {
data = _.extend(this.options, data);
var errored, f, k, key, port, ports, ran, succeeded, user, users, _i, _j, _len, _len1, _ref, _users, _results;
if (data.hasOwnProperty('checker_private_key') && data.checker_private_key) {
Function override_adapter_list
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
var override_adapter_list = function(rows, options) {
var i, len, keys, idx;
// manual list union
if (options.adapter_manual) {
rows = _.union(rows, options.adapter_manual);
- 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 check_nodes
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
SshCheck.prototype.check_nodes = function(hash, callback) {
var done, key, _results, data;
if (hash instanceof Array) {
data = hash;
Function exports
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (options) {
this.list = function (callback) {
shell.config.silent = true;
try {
Function list
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.list = function (callback) {
shell.config.silent = true;
try {
AWS.config.update({accessKeyId: options.adapter_aws_access_key_id, secretAccessKey: options.adapter_aws_secret_access_key});
Function override_adapter_list
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var override_adapter_list = function(rows, options) {
var i, len, keys, idx;
// manual list union
if (options.adapter_manual) {
rows = _.union(rows, options.adapter_manual);
Function guid
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.guid = function(elt, host) {
var keys, name;
var sum = crypto.createHash('sha1');
var hex_high_10 = { // set the highest bit and clear the next highest
'0': '8',
Function export_data
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var export_data = function(format, data, target, display_changeset) {
var actual;
if (typeof display_changeset != "undefined" && display_changeset && Fs.existsSync(expandHomedir(target))) {
switch (format) {
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (options) {
this.list = function (callback) {
shell.config.silent = true;
try {
/* Override cmd */
- 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 (!sent) {
callback(err);
}
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (options) {
this.list = function (callback) {
shell.config.silent = true;
try {
- 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 (!sent) {
callback(new Error("No tentative succeeded"));
}
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (options) {
this.list = function (callback) {
shell.config.silent = true;
try {
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (options) {
this.export = function (data, callback) {
if (typeof global.config.exporter_format != "undefined")
tools.export_data(global.config.exporter_format, data, expandHomedir(global.config.exporter_path), global.config.exporter_print_diff);
if (typeof global.config.exporter_path != "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 export_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var export_data = function(format, data, target, display_changeset) {
var actual;
if (typeof display_changeset != "undefined" && display_changeset && Fs.existsSync(expandHomedir(target))) {
switch (format) {
- 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"