engagementgamelab/CivicSeed

View on GitHub

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)
Severity: Minor
Found in server/rpc/game/player.js - About 1 hr to fix

    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?
    Severity: Minor
    Found in client/code/system/backbone.js - About 1 hr to fix

      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 {
      Severity: Minor
      Found in client/code/game/game.pathfinder.js - About 1 hr to fix

        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(
        Severity: Minor
        Found in client/code/game/game.render.js - About 1 hr to fix

          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 {
          Severity: Minor
          Found in server/middleware/account.js - About 1 hr to fix

          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')
          Severity: Minor
          Found in server/rpc/shared/profiles.js - About 1 hr to fix

          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
          Severity: Minor
          Found in client/code/game/game.skins.js - About 1 hr to fix

          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) {
          Severity: Minor
          Found in client/code/game/game.npc.js - About 1 hr to fix

          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') {
          Severity: Minor
          Found in client/code/system/backbone.js - About 1 hr to fix

            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 {
            Severity: Minor
            Found in server/rpc/admin/startup.js - About 1 hr to fix

              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()
              Severity: Minor
              Found in client/code/game/game.player.js - About 1 hr to fix

                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()
                Severity: Minor
                Found in client/code/game/game.main.js - About 1 hr to fix

                  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>'
                  
                  
                  Severity: Minor
                  Found in client/code/admin/admin.js - About 1 hr to fix

                    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)
                    Severity: Minor
                    Found in server/rpc/game/player.js - About 1 hr to fix

                      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()
                      Severity: Minor
                      Found in client/code/game/game.player.js - About 1 hr to fix

                        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) {
                        Severity: Minor
                        Found in server/rpc/shared/profiles.js - About 1 hr to fix

                          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()
                          
                          
                          Severity: Minor
                          Found in client/code/game/game.skins.js - About 1 hr to fix

                            Function getSmalltalk has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Npc.prototype.getSmalltalk = function () {
                              var dialog = ''
                              var place = ''
                            
                              if (this.isHolding) {
                            Severity: Minor
                            Found in client/code/game/game.npc.js - About 1 hr to fix

                              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
                              Severity: Minor
                              Found in client/code/game/game.skins.js - About 1 hr to fix

                                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) {
                                Severity: Minor
                                Found in client/code/game/game.audio.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language