Showing 312 of 527 total issues
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 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 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 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 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_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_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 to_unix
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function to_unix(date) {
var new_date;
try {
if (/^\d+$/.test(date)) {
var year = parseInt(date.slice(0, 4)),
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;
Function run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const run = () => {
if (running) return;
running = true;
// eslint-disable-next-line consistent-return
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 use
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.use = function (obj) {
for (const key in obj) {
if (defaults.hasOwnProperty(key)) {
if (key == 'protocol' && ['http', 'https'].indexOf(obj[key]) === -1) {
logger.error(`Invalid protocol: ${obj[key]}`);
- 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"
Further reading
Function notifyAck
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.notifyAck = (ackId, type, id, sent, retries = 0) => {
if (retries >= retriesMaxAck) {
removeAckFromArray(ackId);
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 remote
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.remote = function(values, cb) {
var wants_version = values.version;
var destination = values['-d'] || paths.versions;
- 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 send
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const send = function (attempt, method, path, data, options, cb) {
if (!defaults.client) {
const err = new Error('No HTTP client set!');
if (cb) return cb(err);
return 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"
Further reading
Function create_server
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const create_server = (cb) => {
if (osName === 'linux') return cb(new Error('Service only available for mac and windows'));
check_service((valid) => {
if (!valid) return cb(new Error('Windows Service not compatible'));
- 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"