Showing 551 of 551 total issues
Function get_firmware_info
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.get_firmware_info = function(callback) {
var get_value = function(output, string) {
var regex = new RegExp(string + ": (.*)");
var matches = output.toString().match(regex);
Function create_server
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var create_server = (cb) => {
os_name = os.platform().replace('darwin', 'mac').replace('win32', 'windows');
if (os_name == 'linux') return cb(new Error('Service only available for mac and windows'));
check_service((valid) => {
Function get_update_data
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
package.get_update_data = (cb) => {
var location = require('./agent/triggers/location'),
data = {public_ip: null, country: null, location: {lat: null, lon: null}},
loc = location.current;
Function check_hostname
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var check_hostname = () => {
if (checking) return;
checking = true;
var done = (err) => {
Function start
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.start = (id, opts, cb) => {
const done = (err = null) => {
if (err) return cb(err);
if (!emitter) emitter = new Emitter();
cb(err, emitter);
Function get_encryption_status
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports.get_encryption_status = function(cb) {
logger.info("Getting encryption status");
system.get_as_admin_user('encryptStatus', (err, info) => {
if (err) return cb(err);
if (!Array.isArray(info)) return cb(new Error("Invalid encryption status information"));
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
exports.start = function (cb) {
var count,
last_err,
files_removed = [];
- 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 parse_access_points_list
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.parse_access_points_list = function(output) {
return output.split(/Cell \d\d - /).splice(1).map(function(block) {
var parsed = {};
- 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 get_process_list
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.get_process_list = function(callback) {
var processes = [],
cmd = 'ps axo stat,user,ppid,pid,pcpu,pmem,time,comm | egrep -v " ps|grep"';
- 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 parse_access_points_list_netsh
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.parse_access_points_list_netsh = (out) => {
// eslint-disable-next-line prefer-const
let list = [];
const blocks = out.split(/\nSSID \d{1,2}\s:/);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
exports.start = function (cb) {
var count,
last_err,
folders_removed = [];
- 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 get_process_list
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.get_process_list = function(callback) {
var processes = [],
cmd = 'ps axo stat,user,ppid,pid,pcpu,pmem,time,comm | egrep -v " ps|grep"';
- 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 get_encryption_keys
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports.get_encryption_keys = function(cb) {
logger.info("Getting encryption keys");
system.get_as_admin_user('recoveryKeys', (err, info) => {
if (err) return cb(err);
if (!Array.isArray(info)) return cb(new Error("Invalid encryption keys information"));
- 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_service
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.check_service = function(data, cb) {
if (exports.monitoring_service_go) {
if (typeof cb !== 'function')
return;
return cb(null, data);
- 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 RemoteDesktop
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var RemoteDesktop = function(options){
var self = this;
var options = 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 move
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var move = function(from, to, cb) {
if (process.platform != 'win32')
return fs.rename(from, to, cb);
// on windows, antivirus softwares lock new folders until all files are scanned
- 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 verificationPreyConfiguration
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const verificationPreyConfiguration = (callback) => {
try {
clearIntervalDbPreyConf();
saveDataVerify(() => {});
dbPreyConfInterval = setIntervalDbPreyConf();
- 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 notify_action
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.notify_action = function (status, id, name, opts, err, out) {
if (name === 'geofencing' || name === 'triggers') return; // geofencing and triggers needs to send custom notification
let body = {
command: 'start',
Function get_access_points_list
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.get_access_points_list = (callback) => {
let cmd;
let parser;
let list = [];
Function osQueryModeData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const osQueryModeData = (opts, done) => {
let args = null;
const data = {
key: 'device-key',
token: 'token',