Showing 258 of 421 total issues
Function actions
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
var gameModel = ss.service.db.model('Game')
var npcModel = ss.service.db.model('Npc')
Function actions
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
var UserModel = ss.service.db.model('User')
var GameModel = ss.service.db.model('Game')
Function makeResumeFormHTML
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
makeResumeFormHTML: function (resource) {
var html = ''
// Notes on questions and desired functionality from Sam's Google Doc
switch (resource.answer) {
Function actions
has 111 lines of code (exceeds 25 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')
File game.others.js
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
/* global ss, $, $game */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Function exports
has 106 lines of code (exceeds 25 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) {
File game.npc.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
/* global ss, $, $game */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_botanist
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
var _botanist = {
data: {},
state: null,
tutorialState: 0,
File data.skinsuits.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Ideally, this is JSON, and is formatted as such
// But the browserify module bundled with socketstream
// does not currently support JSON, so we just
// manually attach it to module.exports
_boss
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
var _boss = {
grid: [],
totalScore: null,
modeScore: null,
Function calculateSeeds
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
calculateSeeds: function (options) {
var tiles = []
// Get the tiles that need to be bombed
if (options.radius > 1) {
- 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 npcs.js
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
/* global CivicSeed, ss, $, apprise */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Function displayNpcComments
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
displayNpcComments: function () {
// Clear any previous comment bubbles
$player.clearNpcComments()
// Get on-screen NPCs
- 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 drawSeed
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
drawSeed: function (pos) {
if (_seeds.draw > 0) {
var drawLocal = false
if ($player.seedMode === 'draw') {
var currentTile = $game.$map.currentTiles[pos.x][pos.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 actions
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
var gameModel = ss.service.db.model('Game')
var npcModel = ss.service.db.model('Npc')
- 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 onClick
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function onClick (mouseInfo) {
if (mouseInfo.event.which === 3) {
console.log('Right mouse button clicked')
}
- 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 loadRoutes
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadRoutes: function (app) {
require('/admin').init()
require('/export').init()
require('/invitecodes').init()
Function init
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
// When a new player has joined
ss.event.on('ss-addPlayer', function (data, chan) {
$game.$others.add(data.info)
if (data.info._id !== $game.$player.id) {
Function renderTiles
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
renderTiles: function (position) {
var topLeftX = position.x - 1
var topLeftY = position.y - 1
var squares = []
var min = 100
- 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 setupMonitor
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupMonitor () {
getQuestions()
$body.on('click', '#players', function () {
var instance = $(this).attr('data-instance')