Showing 323 of 551 total issues
Function start
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.start = function (id, options, cb) {
const osName = os.platform().replace('darwin', 'mac').replace('win32', 'windows');
if (osName !== 'windows') {
const error = new Error('Action only allowed on Windows 1O');
Function RemoteDesktop
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RemoteDesktop = function(options){
var self = this;
var options = options || {};
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 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 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 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 __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 createServer
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createServer = (cb) => {
if (osName === 'linux') return cb(new Error('Service only available for mac and windows'));
checkService((valid) => {
if (!valid) return cb(new Error('Windows Service not compatible'));
Function fetchLocation
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fetchLocation = (typeFetch, callback) => {
if (callback && typeof callback === 'function') locCallbacks.push(callback);
if (checking) return;
const fireCallbacks = (err, coords) => {
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 createConnectionSocket
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createConnectionSocket = (messageToSendSocket, cb) => {
try {
const existsFile = fs.existsSync(socketFile);
if (!existsFile) {
logger.error('The socket file does not exist');
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 spawn
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const spawn = () => {
const wipeOpts = [
'-token', opts.token,
cloud.toString(),
directories.toString(),