Showing 421 of 421 total issues
exports
has 64 functions (exceeds 20 allowed). Consider refactoring. Open
var $player = module.exports = {
firstName: null,
id: null,
game: null,
File player.js
has 550 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
var rootDir = process.cwd()
var emailUtil = require(rootDir + '/server/utils/email')
var winston = require('winston')
Function exports
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var _npc = {
data: {},
// Add an npc to the data object
- 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 _processResumeAnswers
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
function _processResumeAnswers (data) {
for (var i = 0; i < data.resources.length; i++) {
var resource = data.resources[i]
if (resource.questionType === 'resume') {
var answer = resource.answers[0]
- 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 exports
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var _npc = {
data: {},
// Add an npc to the data object
Function actions
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
var Npc = ss.service.db.model('Npc')
var Game = ss.service.db.model('Game')
- 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 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
req.use('account.authenticated')
var userModel = ss.service.db.model('User')
Function exports
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var _positions = [
{x: 7, y: 20, d: -1, target: -3},
{x: 137, y: 33, d: 1, target: 145},
{x: 137, y: 124, d: 1, target: 145},
Function actions
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
var npcModel = ss.service.db.model('Npc')
var tileModel = ss.service.db.model('Tile')
File game.main.js
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
/* global ss, Davis, JT, $, $CONTAINER, apprise */
// PRIVATE GAME VARS
var _stepNumber = 0
Function addContent
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
addContent: function (resourceId, section, slide) {
var overlay = document.getElementById('resource-area')
var answer = $game.$player.getAnswer(resourceId)
var isAnswered = (answer && answer.result) ? true : false
var isRevisit = $game.flags.check('viewing-inventory')
Function actions
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
var npcModel = ss.service.db.model('Npc')
var tileModel = ss.service.db.model('Tile')
- 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 exports
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
return {
ready: false,
// load in other players
- 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 exports
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
var _minimap = {}
var _minimapPlayerContext = null
var _minimapRadarContext = null
var _utils
Function saveChanges
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
function saveChanges (id) {
var $npc = $('#admin-npcs').find('.npc' + id)
var informationAreas = $npc.find('.information textarea, .information input')
var resourceAreas = $npc.find('.resource textarea, .resource input')
var promptAreas = $npc.find('.prompts textarea')
Function addContent
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
addContent: function (section) {
var overlay = document.getElementById('botanist-area')
var content = overlay.querySelector('.botanist-content')
// Reset all resource slides and buttons to a hidden & clean state.
Function accountHandlers
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
accountHandlers: function () {
var $body = $(document.body)
$body.on('submit', '#login-form', function() {
var email = document.getElementById('username').value.toLowerCase()
File game.audio.js
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
/* global ss, CivicSeed, $game, Howl, Howler */
var _soundtracks = []
var _triggerFx = null
Function exports
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function () {
var _inventory = {} // Holds each item in inventory.
// Returns true if a resource is held in the player's inventory
function isInInventory (item) {
- 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 exports
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
// Placeholder for chat display time, after which a setTimeout is used to hide the chat bubble.
var displayTimer = null
var badWords = ['fuck', 'shit', 'bitch', 'cunt', 'damn', 'penis', 'vagina', 'crap', 'screw', 'suck', 'piss', 'whore', 'slut']