Showing 323 of 551 total issues
Function lock_binary_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function lock_binary_path() {
var binary_name = 'prey-lock';
if (is_win) {
binary_name = (release >= '6.1') ? 'new-prey-lock' : 'prey-lock';
- 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 validate_new_user_fields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_new_user_fields(self, name, email, terms, age, passwd, passwd2 = None):
if name == '':
self.show_alert("Please type in your name.")
return False
if email == '':
- 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 delete_profile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var delete_profile = function(ssid, cb) {
get_existing_profiles(function(err, current_profiles) {
// Check if the profile isn't original and exists in the current list also if the device is connected to that ap
if (!ssid || exports.init_profiles.indexOf(ssid) != -1 || current_profiles.indexOf(ssid) == -1 || connected_to.ssid == ssid) {
return cb(new Error("Nothing to delete " + 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
storage_fns.update = (opts, cb) => {
init(opts.type, null, (err) => {
let changes,
values = opts.values,
columns = opts.columns;
- 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 status_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.status_info = (cb) => {
providers.get('status', (err, stdout) => {
const statusStd = stdout;
if (!err && stdout) {
if (!statusStd.logged_user) statusStd.logged_user = 'null';
- 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 clearAndResetIntervals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const clearAndResetIntervals = (aliveTimeReset = false) => {
if (notifyAckInterval) clearInterval(notifyAckInterval);
if (notifyActionInterval) clearInterval(notifyActionInterval);
if (getStatusInterval) clearInterval(getStatusInterval);
if (setIntervalWSStatus) clearInterval(setIntervalWSStatus);
- 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 tryToSendNew
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const tryToSendNew = () => {
// eslint-disable-next-line array-callback-return, consistent-return
messagesData = messagesData.reduce((acc, element) => {
const timeObj = element.time;
if (((new Date()).getTime() - timeObj) >= element.timeLimitPerMessage) {
- 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 postIt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const postIt = (data) => {
if (!data || Object.keys(data).length === 0) return;
logger.info('New location obtained! Making the Control Panel aware...');
devices.post_location(data, (err, state) => {
- 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 changeTab
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def changeTab(self, dir):
index = self.getCurrentTab()
if index == 0: # first page
self.prev.setHidden_(False)
- 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 getRestartsPreyconf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getRestartsPreyconf = (callback) => {
try {
// eslint-disable-next-line consistent-return
getDataDb('restarts_preyconf', (err, stored) => {
if (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
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return cb(null, out);
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
if (!checkRangeFormat(dateFrom, dateUntil)) return 4;
Avoid too many return
statements within this function. Open
return 2;
Avoid too many return
statements within this function. Open
return 2;
Avoid too many return
statements within this function. Open
if (currentDate > endDate) return 3;
Avoid too many return
statements within this function. Open
|| date.getTime() > dateUntil) return;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
if (!exports.currentTriggers) return;