Showing 312 of 527 total issues
Function RemoteDesktop
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RemoteDesktop = function(options){
var self = this;
var options = options || {};
Function start
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
exports.start = function(id, options, cb) {
var error,
self = this,
returned = 0;
- 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 correctPreyConfCallback
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const correctPreyConfCallback = (callback) => {
// eslint-disable-next-line consistent-return
getDataDb('preyconf', (err, data) => {
if (err || !data) {
// eslint-disable-next-line consistent-return
- 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 activate_event
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.activate_event = (trigger) => {
try {
var event_index = trigger.automation_events.findIndex(
(obj) => events_list.indexOf(obj.type) > -1
);
Function get_tree
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.get_tree = function(options, cb) {
var dir = options.path;
// We need to run the tree walker script personifying
Function update_client
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const update_client = function (new_version, cb) {
let child;
let error;
const out = [];
const versions_path = system.paths.versions;
Function __init__
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self):
button_text = "Close"
title = args.title
File index.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
const needle = require('needle');
const Emitter = require('events').EventEmitter;
const https = require('https');
const common = require('../../common');
Function directoryTreeToObj
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
var directoryTreeToObj = function(dir, current_depth, depth, done) {
var resultsDir = [],
resultsFile = [];
if (os_name == 'windows') dir = dir + '\\';
Function as_user
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function as_user(options, cb) {
const { user } = options;
const { bin } = options;
const { type } = options;
const { opts } = options;
- 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 start
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
exports.start = function(id, opts, cb) {
var opts = opts || {},
message = opts.message || opts.alert_message,
title = opts.title,
level = opts.level || 'info',
- 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 attach_listeners
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function attach_listeners(request) {
request.on('data', function(data) {
logger.info("Data received!");
try {
Function start
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.start = function(id, opts, cb) {
var opts = opts || {},
message = opts.message || opts.alert_message,
title = opts.title,
level = opts.level || 'info',
Function start
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.start = function (id, options, cb) {
const url = `${UPLOAD_SERVER}?uploadID=${options.file_id}`;
// Make a call to get the last byte processed by the upload server
// in order to resume the upload from that position.
needle.request('get', url, null, (err, res) => {
Function sync
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.sync = function(id, geofences, cb) {
exports.watching = [];
if(!geofences || geofences.length == 0)
done(id, cb);
Function check
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.check = function (id, target, opts, cb) {
function done(err) {
if (cb && typeof cb === 'function') return cb && cb(err);
}
Function RemoteTerminal
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RemoteTerminal = function(options) {
var self = this;
var options = options || {};
Function spawn
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const spawn = () => {
const wipeOpts = [
'-token', opts.token,
cloud.toString(),
directories.toString(),
Function get_active_access_point
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
exports.get_active_access_point = (callback) => {
exports.isWifiPermissionActive((itWorks) => {
if (itWorks) {
const processActiveAp = (stdout) => {
if (stdout.includes('AirPort: Off') || !stdout.includes('SSID')) {
- 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 gather
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const gather = (reportName, list, cb) => {
const data = {};
let gathered = false;
let count = list.length;
let listReports = [...list];
- 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"