Showing 258 of 421 total issues
Function collaborativeChallenge
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
collaborativeChallenge: function () {
// get all active players locations
_userModel
.where('role').equals('actor')
.where('activeSessionID').ne(null)
Function start
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
// Private - holder of graph tiles for current screen
var _graph
return {
Function renderBossTiles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderBossTiles: function (tiles) {
for (var t = 0; t < tiles.length; t++) {
$render.clearMapTile(tiles[t])
_backgroundContext.fillStyle = tiles[t].color
_backgroundContext.fillRect(
Function authenticated
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.authenticated = function (framework) {
return function (req, res, next) {
if (req.session && (req.session.userId !== null)) {
return next()
} else {
- 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 12 (exceeds 5 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')
- 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 renderSkinformation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function renderSkinformation () {
var playerSkin = $game.$player.getSkinSuit()
var skins = data.outfits
var head = playerSkin.head
var torso = playerSkin.torso
- 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 getSmalltalk
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Npc.prototype.getSmalltalk = function () {
var dialog = ''
var place = ''
if (this.isHolding) {
- 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 save
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function(key, val, options) {
var attrs, method, xhr, attributes = this.attributes;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
Function actions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.actions = function (req, res, ss) {
req.use('session')
req.use('account.authenticated')
return {
Function saveResource
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
saveResource: function (resource) {
var playerResource = _resources[resource.id]
var npc = $game.$npc.findNpcByResourceId(resource.id)
var npcLevel = npc.getLevel()
var playerLevel = $player.getLevel()
Function updateProgressOverlay
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateProgressOverlay: function () {
var playerLevel = $game.$player.getLevel()
var tilesColored = $game.$player.getTilesColored()
var resourcesDiscovered = $game.$player.getResourcesDiscovered()
var totalResources = $game.$resources.getTotalResourceCount()
Function showPlayerAnswers
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showPlayerAnswers (index) {
var resources = players[index].game.resources
var numNPC = allQuestions.length
var html = '<h2>' + players[index].firstName + ' ' + players[index].lastName + '</h2>'
Function exitPlayer
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
exitPlayer: function (player) {
if (player.id) {
_userModel.findById(player.id, function (err, user) {
if (err) {
console.log(err)
Function beam
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
beam: function (location) {
$game.flags.set('is-beaming')
$game.flags.set('screen-transition')
$game.$input.resetUI()
$game.$chat.clearAllChats()
Function getProfileInformation
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
getProfileInformation: function (playerId) {
// playerId could be what's in either profileLink (just the profile Id random char string)
// or a custom one that's set by the user.
UserModel.findOne({ profileLink: playerId }, function (err, user) {
Function renderSkinventoryUI
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderSkinventoryUI () {
var playerSkin = $game.$player.getSkinSuit()
var unlocked = $game.$player.getSkinventory()
var skins = getSets()
Function getSmalltalk
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Npc.prototype.getSmalltalk = function () {
var dialog = ''
var place = ''
if (this.isHolding) {
Function renderSkinformation
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderSkinformation () {
var playerSkin = $game.$player.getSkinSuit()
var skins = data.outfits
var head = playerSkin.head
var torso = playerSkin.torso
Function loadTriggerFx
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadTriggerFx: function () {
var mp3 = _musicPath + 'triggers.mp3?VERSION='
var ogg = _musicPath + '/ogg/triggers.ogg?VERSION='
if (_extension) {