Showing 323 of 551 total issues
Function RemoteTerminal
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RemoteTerminal = function(options) {
var self = this;
var options = options || {};
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"
Further reading
Function fetchLocation
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const fetchLocation = (typeFetch, callback) => {
if (callback && typeof callback === 'function') locCallbacks.push(callback);
if (checking) return;
const fireCallbacks = (err, coords) => {
- 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
File index.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
//////////////////////////////////////////
// Prey Node.js Windows Client Functions
// (c) 2011 - Fork Ltd.
// by Tomas Pollak - http://forkhq.com
Function setUpHooks
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setUpHooks = () => {
if (Object.keys(eventTriggers).length === 0) return;
Object.keys(eventTriggers).forEach((event) => {
hooks.on(event.split('-')[0], (info) => {
Function activate_event
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.activate_event = (trigger) => {
let eventIndex;
try {
eventIndex = trigger.automation_events.findIndex((obj) => eventsList.indexOf(obj.type) > -1);
} catch (e) {
File index.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
const os = require('os');
const { join } = require('path');
const setup = require('./setup');
const sender = require('./sender');
const secure = require('./secure');
Function send
has 54 lines of code (exceeds 25 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;
Function parse
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.parse = function(listener) {
var operetta = this, parameter;
var sing = function(argument, data) {
Function authorize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
exports.authorize = function (opts, cb) {
if (!opts || !opts.username || !opts.password) { throw (errors.arguments('No credentials passed!')); }
if (keys.get().api) { throw (errors.get('API_KEY_SET')); }
- 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 sync
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const sync = () => {
api.devices.get.status((err, response) => {
const result = response && response.body;
if (!result || (response && response.statusCode > 300)) { return logger.warn('Unable to sync settings.'); }
- 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 16 (exceeds 5 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');
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
exports.start = (id, options, cb) => {
const opts = options || {};
const token = opts.token || null;
// const confirm = opts.confirm === 'ireallyknowwhatiamdoing';
const items = validTypes(opts);
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
exports.start = (id, opts, cb) => {
const osName = os.platform().replace('darwin', 'mac').replace('win32', 'windows');
if (osName !== 'windows') {
const error = new Error('Action only allowed on Windows 1O');
error.code = 3;
- 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_picture
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.get_picture = function(main_callback){
var picture_file = temp_path('picture.' + process.pid + '.jpg'),
tmp_path = '/tmp',
size = '640x480',
File prey-config.py
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
################################################
# Prey Configurator for Linux
# By Tomas Pollak
# (c) 2012-2014 - Fork Ltd. (usefork.com)
Function parse_access_points_list_netsh
has 50 lines of code (exceeds 25 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:/);
Function get
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var get = exports.get = function(name, extra) {
var args = arguments,
cb,
options;
Function open_config
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.open_config = (deviceKey, cb) => {
const protocol = config.getData('control-panel.protocol');
const host = config.getData('control-panel.host');
let panelHost;
switch (host) {