Showing 323 of 551 total issues
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',
Function send_update_event
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var send_update_event = (type, status, old_version, new_version, attempt, error, cb) => {
const config = require('./utils/configfile');
var shared = require('./conf/shared');
shared.keys.verify_current(function(err) {
Function load_hooks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function load_hooks() {
storage.do('query', { type: 'keys', column: 'id', data: 'last_connection' }, (err, stored) => {
if (err) logger.info('Error getting the last connection data');
if (stored && stored.length > 0) {
last_stored = stored[0];
Function get_process_list
has 26 lines of code (exceeds 25 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"';
Function get_killswitch_compatible
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.get_killswitch_compatible = (cb) => {
const data = {
key: 'device-key',
token: 'token',
logged: false,
Function get_ram_module_list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.get_ram_module_list = (cb) => {
const list = [];
const file = join(__dirname, 'ramcheck.vbs');
// eslint-disable-next-line consistent-return
Function setUpVersion
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setUpVersion = function (version, cb) {
const finish = () => {
log(`Setting permissions on ${paths.current}`);
exports.chmodr(paths.current, 0o755, function (err) {
if (err) return cb(err);
Function get_process_list
has 26 lines of code (exceeds 25 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"';
Function parse_access_points_list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.parse_access_points_list = function(output) {
return output.split(/Cell \d\d - /).splice(1).map(function(block) {
var parsed = {};
Function get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const get = (reportName, options, callback) => {
let cb;
let optionsGet;
if (typeof options === 'function') {
cb = options;
Consider simplifying this complex logical expression. Open
if (reportName === 'specs' && osName === 'windows' && gte(system.os_release, '10.0.0')
&& data.os_edition && editions.includes(data.os_edition)
&& data.winsvc_version && gte(data.winsvc_version, '2.0.0')) {
providers.get('tpm_module', (err, output) => {
if (!err) data.tpm_module = output;
Function bind
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Operetta.prototype.bind = function(args, description, listener, type) {
if (args) {
var operetta = this;
if (args.constructor !== Array)
- 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 pre_uninstall
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.pre_uninstall = (values, cb) => {
const argument = values['-u'] && values.positional[0];
const updating = argument == 'true' || parseInt(argument) === 1;
const tasks = [daemon.remove, osHooks.pre_uninstall];
- 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_for_update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const check_for_update = function (cb) {
config.load(() => {
if (!exports.check_enabled || exports.upgrading) {
if (cb && typeof cb === 'function') return cb();
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 get_active_access_point_mac
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.get_active_access_point_mac = (callback) => {
if (release >= 6.0) {
// eslint-disable-next-line consistent-return
exec('netsh wlan show interfaces', (err, stdout) => {
if (err) return callback(err);
- 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"