Showing 258 of 421 total issues
Avoid too many return
statements within this function. Open
if (aStack[length] == a) return bStack[length] == b;
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return result;
Avoid too many return
statements within this function. Open
default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
Function loadUsers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadUsers: function (req, res, ss) {
var userData = require(rootDir + '/data/users.json')
var userDataCopy = _JSONClone(userData)
var numDemoUsers = 16
var demoUsers = []
- 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 actions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
req.use('account.authenticated')
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 getAndSetNetworkIp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getAndSetNetworkIp: function (callback) {
serverHelpers.getNetworkIPs(function (err, ips) {
if (err || !ips.length) {
config.set('IP', 'localhost')
winston.warn('CS:'.blue + ' Could not find network IP. Defaulting to \'localhost.\''.red)
- 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 getGameRegion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getGameRegion: function () {
// Compare player position to centers of the world
var position = this.getPosition()
var posX = position.x
var posY = position.y
- 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 newBomb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
newBomb: function (bombed, id) {
for (var b = 0; b < bombed.length; b += 1) {
// only add it to render list if it is on current screen
var loc = $map.masterToLocal(bombed[b].x, bombed[b].y)
var curTile = 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 loadSkinSuitImages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadSkinSuitImages: function (num) {
if (num === undefined) num = 0
var next = num + 1
var skinsList = $game.$skins.getSetsList()
- 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 loadVideo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadVideo: function (number) {
var videoEl = document.createElement('video')
var path = CivicSeed.CLOUD_PATH + '/audio/cutscenes/'
if (CivicSeed.ENVIRONMENT === 'development') {
- 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 checkEnvironmentOnceFx
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
checkEnvironmentOnceFx: function () {
var numPlaces = _environmentOnceFxPlaces.length
var p = 0
while (p < numPlaces) {
- 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 forEachGridTile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
forEachGridTile: function (func) {
var gridX = $game.VIEWPORT_WIDTH
var gridY = $game.VIEWPORT_HEIGHT
for (var x = 0; x < gridX; x++) {
- 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 checkEnvironmentLoopFx
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
checkEnvironmentLoopFx: function () {
var numPlaces = _environmentLoopFxPlaces.length
var p = 0
while (p < numPlaces) {
- 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 beginTransition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
beginTransition: function () {
// Verify that the player is at the edge of a screen
// Refuse transition if player is not at a transitional edge
// This catches bugs
var position = $game.$player.getLocalPosition()
- 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 renderFrame
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderFrame: function () {
// $game.$others.clear();
// $game.$player.clear();
// $game.$npc.clear();
// $game.$botanist.clear();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
update: function () {
var trackNum = whichTrack()
var message = 'Entering '
if (_soundtracks[trackNum]._loaded && trackNum !== _currentTrack && !_midTransition) {
- 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"