Moogsoft/moog-graze

View on GitHub
lib/moog-graze.js

Summary

Maintainability
F
5 mos
Test Coverage

File moog-graze.js has 3263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Created by stephen on 17/05/2016.
 */

// Export the options and the graze methods
Severity: Major
Found in lib/moog-graze.js - About 1 wk to fix

    Function callGrazeEndpoint has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function callGrazeEndpoint(opts, body)
    {
    
      return new Promise(function (resolve, reject)
      {
    Severity: Major
    Found in lib/moog-graze.js - About 3 hrs to fix

      Function setSituationProcesses has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Graze.prototype.setSituationProcesses = function (sitnId, processList, primaryProcess, callback)
      {
        debug("Entering setSituationProcesses");
        var opts = this.connectOptions;
        var self = this;
      Severity: Major
      Found in lib/moog-graze.js - About 2 hrs to fix

        Function setSituationServices has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Graze.prototype.setSituationServices = function (sitnId, serviceList, primaryService, callback)
        {
          debug("Entering setSituationServices");
          var opts = this.connectOptions;
          var self = this;
        Severity: Major
        Found in lib/moog-graze.js - About 2 hrs to fix

          Function createUser has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Graze.prototype.createUser = function (userObj, callback)
          {
            debug("Entering createUser");
            var opts = this.connectOptions;
            var self = this;
          Severity: Major
          Found in lib/moog-graze.js - About 2 hrs to fix

            Function assignSituation has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Graze.prototype.assignSituation = function (sitnId, user, callback)
            {
              debug("Entering assignSituation");
              var opts = this.connectOptions;
              var self = this;
            Severity: Major
            Found in lib/moog-graze.js - About 2 hrs to fix

              Function assignAndAcknowledgeAlert has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Graze.prototype.assignAndAcknowledgeAlert = function (alertId, user, callback)
              {
                debug("Entering assignAndAcknowledgeAlert");
                var opts = this.connectOptions;
                var self = this;
              Severity: Major
              Found in lib/moog-graze.js - About 2 hrs to fix

                Function assignAndAcknowledgeSituation has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Graze.prototype.assignAndAcknowledgeSituation = function (sitnId, user, callback)
                {
                  debug("Entering assignAndAcknowledgeSituation");
                  var opts = this.connectOptions;
                  var self = this;
                Severity: Major
                Found in lib/moog-graze.js - About 2 hrs to fix

                  Function assignAlert has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Graze.prototype.assignAlert = function (alertId, user, callback)
                  {
                    debug("Entering assignAlert");
                    var opts = this.connectOptions;
                    var self = this;
                  Severity: Major
                  Found in lib/moog-graze.js - About 2 hrs to fix

                    Function mergeSituations has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Graze.prototype.mergeSituations = function (situations, supersedeOriginal, callback)
                    {
                      debug("Entering mergeSituations");
                      var opts = this.connectOptions;
                      var self = this;
                    Severity: Major
                    Found in lib/moog-graze.js - About 2 hrs to fix

                      Function createTeam has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Graze.prototype.createTeam = function (teamObj, callback)
                      {
                        debug("Entering createTeam");
                        var opts = this.connectOptions;
                        var self = this;
                      Severity: Major
                      Found in lib/moog-graze.js - About 2 hrs to fix

                        Function createMaintenanceWindow has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Graze.prototype.createMaintenanceWindow = function (maintObj, callback)
                        {
                          debug("Entering createMaintenanceWindow");
                          var opts = this.connectOptions;
                          var self = this;
                        Severity: Major
                        Found in lib/moog-graze.js - About 2 hrs to fix

                          Function updateTeam has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Graze.prototype.updateTeam = function (teamObj, callback)
                          {
                            debug("Entering updateTeam");
                            var opts = this.connectOptions;
                            var self = this;
                          Severity: Major
                          Found in lib/moog-graze.js - About 2 hrs to fix

                            Function setAlertSeverity has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Graze.prototype.setAlertSeverity = function (alertId, severity, callback)
                            {
                              debug("Entering setAlertSeverity");
                              var opts = this.connectOptions;
                              var self = this;
                            Severity: Major
                            Found in lib/moog-graze.js - About 2 hrs to fix

                              Function removeAlertFromSituation has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              Graze.prototype.removeAlertFromSituation = function (alertId, sitnId, callback)
                              {
                                debug("Entering removeAlertFromSituation");
                                var opts = this.connectOptions;
                                var self = this;
                              Severity: Major
                              Found in lib/moog-graze.js - About 2 hrs to fix

                                Function setSituationDescription has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                Graze.prototype.setSituationDescription = function (sitnId, description, callback)
                                {
                                  debug("Entering setSituationDescription");
                                  var opts = this.connectOptions;
                                  var self = this;
                                Severity: Major
                                Found in lib/moog-graze.js - About 2 hrs to fix

                                  Function setAlertAcknowledgeState has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Graze.prototype.setAlertAcknowledgeState = function (alertId, acknowledged, callback)
                                  {
                                    debug("Entering setAlertAcknowledgeState");
                                    var opts = this.connectOptions;
                                    var self = this;
                                  Severity: Major
                                  Found in lib/moog-graze.js - About 2 hrs to fix

                                    Function setSituationExternalSeverity has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    Graze.prototype.setSituationExternalSeverity = function (sitnId, severity, callback)
                                    {
                                      debug("Entering setSituationExternalSeverity **WARNING** Deprecated 5.2.3+");
                                      var opts = this.connectOptions;
                                      var self = this;
                                    Severity: Major
                                    Found in lib/moog-graze.js - About 2 hrs to fix

                                      Function addSigCorrelationInfo has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      Graze.prototype.addSigCorrelationInfo = function (sitnId, serviceName, resourceId, callback)
                                      {
                                        debug("Entering addSigCorrelationInfo");
                                        var opts = this.connectOptions;
                                        var self = this;
                                      Severity: Major
                                      Found in lib/moog-graze.js - About 2 hrs to fix

                                        Function setSituationAcknowledgeState has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        Graze.prototype.setSituationAcknowledgeState = function (sitnId, acknowledged, callback)
                                        {
                                          debug("Entering setSituationAcknowledgeState");
                                          var opts = this.connectOptions;
                                          var self = this;
                                        Severity: Major
                                        Found in lib/moog-graze.js - About 2 hrs to fix

                                          Function authenticate has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          function authenticate(opts)
                                          {
                                          
                                            return new Promise(function (resolve, reject)
                                            {
                                          Severity: Major
                                          Found in lib/moog-graze.js - About 2 hrs to fix

                                            Function addThreadEntry has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            Graze.prototype.addThreadEntry = function (sitnId, threadName, entry, callback)
                                            {
                                              debug("Entering addThreadEntry");
                                              var opts = this.connectOptions;
                                              var self = this;
                                            Severity: Major
                                            Found in lib/moog-graze.js - About 2 hrs to fix

                                              Function closeSituation has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                              Graze.prototype.closeSituation = function (sitnId, resolution, callback)
                                              {
                                                debug("Entering closeSituation");
                                                var opts = this.connectOptions;
                                                var self = this;
                                              Severity: Major
                                              Found in lib/moog-graze.js - About 2 hrs to fix

                                                Function createThread has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                Graze.prototype.createThread = function (sitnId, threadName, callback)
                                                {
                                                  debug("Entering createThread");
                                                  var opts = this.connectOptions;
                                                  var self = this;
                                                Severity: Major
                                                Found in lib/moog-graze.js - About 2 hrs to fix

                                                  Function addSituationCustomInfo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                  Graze.prototype.addSituationCustomInfo = function (sitnId, customInfo, callback)
                                                  {
                                                    debug("Entering addSituationCustomInfo");
                                                    var opts = this.connectOptions;
                                                    var self = this;
                                                  Severity: Major
                                                  Found in lib/moog-graze.js - About 2 hrs to fix

                                                    Function addProcess has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                    Graze.prototype.addProcess = function (name, description, callback)
                                                    {
                                                      debug("Entering addProcess");
                                                      var opts = this.connectOptions;
                                                      var self = this;
                                                    Severity: Major
                                                    Found in lib/moog-graze.js - About 2 hrs to fix

                                                      Function resolveSituation has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      Graze.prototype.resolveSituation = function (sitnId, callback)
                                                      {
                                                        debug("Entering resolveSituation");
                                                        var opts = this.connectOptions;
                                                        var self = this;
                                                      Severity: Major
                                                      Found in lib/moog-graze.js - About 2 hrs to fix

                                                        Function addService has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        Graze.prototype.addService = function (name, description, callback)
                                                        {
                                                          debug("Entering addService");
                                                          var opts = this.connectOptions;
                                                          var self = this;
                                                        Severity: Major
                                                        Found in lib/moog-graze.js - About 2 hrs to fix

                                                          Function addAlertCustomInfo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                          Graze.prototype.addAlertCustomInfo = function (alertId, customInfo, callback)
                                                          {
                                                            debug("Entering addAlertCustomInfo");
                                                            var opts = this.connectOptions;
                                                            var self = this;
                                                          Severity: Major
                                                          Found in lib/moog-graze.js - About 2 hrs to fix

                                                            Function addAlertToSituation has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                            Graze.prototype.addAlertToSituation = function (alertId, sitnId, callback)
                                                            {
                                                              debug("Entering addAlertToSituation");
                                                              var opts = this.connectOptions;
                                                              var self = this;
                                                            Severity: Major
                                                            Found in lib/moog-graze.js - About 2 hrs to fix

                                                              Function deleteMaintenanceWindows has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                              Graze.prototype.deleteMaintenanceWindows = function (filter, limit, callback)
                                                              {
                                                                debug("Entering deleteMaintenanceWindows");
                                                                var opts = this.connectOptions;
                                                                var self = this;
                                                              Severity: Major
                                                              Found in lib/moog-graze.js - About 2 hrs to fix

                                                                Function deleteMaintenanceWindow has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                Graze.prototype.deleteMaintenanceWindow = function (window, callback)
                                                                {
                                                                  debug("Entering deleteMaintenanceWindow");
                                                                  var opts = this.connectOptions;
                                                                  var self = this;
                                                                Severity: Major
                                                                Found in lib/moog-graze.js - About 2 hrs to fix

                                                                  Function closeAlert has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                  Graze.prototype.closeAlert = function (alertId, callback)
                                                                  {
                                                                    debug("Entering closeAlert");
                                                                    var opts = this.connectOptions;
                                                                    var self = this;
                                                                  Severity: Major
                                                                  Found in lib/moog-graze.js - About 2 hrs to fix

                                                                    Function findMaintenanceWindows has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                    Graze.prototype.findMaintenanceWindows = function (filter, limit, callback)
                                                                    {
                                                                      debug("Entering findMaintenanceWindows");
                                                                      var opts = this.connectOptions;
                                                                      var self = this;
                                                                    Severity: Major
                                                                    Found in lib/moog-graze.js - About 2 hrs to fix

                                                                      Function createSituation has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                      Graze.prototype.createSituation = function (description, callback)
                                                                      {
                                                                        debug("Entering createSituation");
                                                                        var opts = this.connectOptions;
                                                                        var self = this;
                                                                      Severity: Major
                                                                      Found in lib/moog-graze.js - About 2 hrs to fix

                                                                        Function deassignSituation has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                        Graze.prototype.deassignSituation = function (sitnId, callback)
                                                                        {
                                                                          debug("Entering deassignSituation");
                                                                          var opts = this.connectOptions;
                                                                          var self = this;
                                                                        Severity: Major
                                                                        Found in lib/moog-graze.js - About 2 hrs to fix

                                                                          Function deassignAlert has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                          Graze.prototype.deassignAlert = function (alertId, callback)
                                                                          {
                                                                            debug("Entering deassignAlert");
                                                                            var opts = this.connectOptions;
                                                                            var self = this;
                                                                          Severity: Major
                                                                          Found in lib/moog-graze.js - About 2 hrs to fix

                                                                            Function getUserRoles has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                            Graze.prototype.getUserRoles = function (user, callback)
                                                                            {
                                                                              debug("Entering getUserRoles");
                                                                              var opts = this.connectOptions;
                                                                              var self = this;
                                                                            Severity: Major
                                                                            Found in lib/moog-graze.js - About 2 hrs to fix

                                                                              Function getUserTeams has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                              Graze.prototype.getUserTeams = function (user, callback)
                                                                              {
                                                                                debug("Entering getUserTeams");
                                                                                var opts = this.connectOptions;
                                                                                var self = this;
                                                                              Severity: Major
                                                                              Found in lib/moog-graze.js - About 2 hrs to fix

                                                                                Function getThreadEntries has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                Graze.prototype.getThreadEntries = function (sitnId, threadName, callback)
                                                                                {
                                                                                  debug("Entering getThreadEntries");
                                                                                  var opts = this.connectOptions;
                                                                                  var self = this;
                                                                                Severity: Minor
                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                  Function getSituationAlertIds has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                  Graze.prototype.getSituationAlertIds = function (sitnId, uniqueOnly, callback)
                                                                                  {
                                                                                    debug("Entering getSituationAlertIds");
                                                                                    var opts = this.connectOptions;
                                                                                    var self = this;
                                                                                  Severity: Minor
                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                    Function req has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                        var req = https.request(opts, (res) =>
                                                                                        {
                                                                                          res.setEncoding('utf8');
                                                                                          var resData = {};
                                                                                          var returnString = "";
                                                                                    Severity: Minor
                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                      Function getSituationHosts has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                      Graze.prototype.getSituationHosts = function (sitnId, uniqueOnly, callback)
                                                                                      {
                                                                                        debug("Entering getSituationHosts");
                                                                                        var opts = this.connectOptions;
                                                                                        var self = this;
                                                                                      Severity: Minor
                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                        Function getSituationDetails has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                        Graze.prototype.getSituationDetails = function (sitnId, callback)
                                                                                        {
                                                                                          debug("Entering getSituationDetails");
                                                                                          var opts = this.connectOptions;
                                                                                          var self = this;
                                                                                        Severity: Minor
                                                                                        Found in lib/moog-graze.js - About 1 hr to fix

                                                                                          Function getTeamSituationIds has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                          Graze.prototype.getTeamSituationIds = function (teamName, callback)
                                                                                          {
                                                                                            debug("Entering getTeamSituationIds");
                                                                                            var opts = this.connectOptions;
                                                                                            var self = this;
                                                                                          Severity: Minor
                                                                                          Found in lib/moog-graze.js - About 1 hr to fix

                                                                                            Function getMaintenanceWindows has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                            Graze.prototype.getMaintenanceWindows = function (start, limit, callback)
                                                                                            {
                                                                                              debug("Entering getMaintenanceWindows");
                                                                                              var opts = this.connectOptions;
                                                                                              var self = this;
                                                                                            Severity: Minor
                                                                                            Found in lib/moog-graze.js - About 1 hr to fix

                                                                                              Function getSituationServices has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                              Graze.prototype.getSituationServices = function (sitnId, callback)
                                                                                              {
                                                                                                debug("Entering getSituationServices");
                                                                                                var opts = this.connectOptions;
                                                                                                var self = this;
                                                                                              Severity: Minor
                                                                                              Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                Function getUserInfo has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                Open

                                                                                                Graze.prototype.getUserInfo = function (user, callback)
                                                                                                {
                                                                                                  debug("Entering getUserInfo");
                                                                                                  var opts = this.connectOptions;
                                                                                                  var self = this;
                                                                                                Severity: Minor
                                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                  Function getSituationProcesses has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                  Graze.prototype.getSituationProcesses = function (sitnId, callback)
                                                                                                  {
                                                                                                    debug("Entering getSituationProcesses");
                                                                                                    var opts = this.connectOptions;
                                                                                                    var self = this;
                                                                                                  Severity: Minor
                                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                    Function getAlertIds has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                    Graze.prototype.getAlertIds = function (query, limit, callback)
                                                                                                    {
                                                                                                      debug("Entering getAlertIds");
                                                                                                      var opts = this.connectOptions;
                                                                                                      var self = this;
                                                                                                    Severity: Minor
                                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                      Function getSituationIds has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                      Graze.prototype.getSituationIds = function (query, limit, callback)
                                                                                                      {
                                                                                                        debug("Entering getSituationIds");
                                                                                                        var opts = this.connectOptions;
                                                                                                        var self = this;
                                                                                                      Severity: Minor
                                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                        Function getSituationDescription has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                        Graze.prototype.getSituationDescription = function (sitnId, callback)
                                                                                                        {
                                                                                                          debug("Entering getSituationDescription");
                                                                                                          var opts = this.connectOptions;
                                                                                                          var self = this;
                                                                                                        Severity: Minor
                                                                                                        Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                          Function getSystemSummary has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          Graze.prototype.getSystemSummary = function (callback)
                                                                                                          {
                                                                                                            debug("Entering getSystemSummary");
                                                                                                            var opts = this.connectOptions;
                                                                                                            var self = this;
                                                                                                          Severity: Minor
                                                                                                          Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                            Function getAlertDetails has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                            Graze.prototype.getAlertDetails = function (alertId, callback)
                                                                                                            {
                                                                                                              debug("Entering getAlertDetails");
                                                                                                              var opts = this.connectOptions;
                                                                                                              var self = this;
                                                                                                            Severity: Minor
                                                                                                            Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                              Function getActiveSituationIds has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                              Graze.prototype.getActiveSituationIds = function (callback)
                                                                                                              {
                                                                                                                debug("Entering getActiveSituationIds");
                                                                                                                var opts = this.connectOptions;
                                                                                                                var self = this;
                                                                                                              Severity: Minor
                                                                                                              Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                Function getSystemStatus has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                Graze.prototype.getSystemStatus = function (callback)
                                                                                                                {
                                                                                                                  debug("Entering getSystemStatus");
                                                                                                                  var opts = this.connectOptions;
                                                                                                                  var self = this;
                                                                                                                Severity: Minor
                                                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                  Function _createUser has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                    var _createUser = function (userObj)
                                                                                                                    {
                                                                                                                      debug('Entering _createUser');
                                                                                                                      debug('_createUser authToken: ' + opts.authToken);
                                                                                                                      return new Promise(function (resolve, reject)
                                                                                                                  Severity: Minor
                                                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                    Function _setSituationProcesses has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                    Open

                                                                                                                      var _setSituationProcesses = function (sitnId, processList, primaryProcess)
                                                                                                                      {
                                                                                                                        debug('Entering _setSituationProcesses sitn_id:' + sitnId +
                                                                                                                          ' process_list:' + processList + ' [optional primary_process:' + primaryProcess + ']');
                                                                                                                        debug('_setSituationProcesses authToken: ' + opts.authToken);
                                                                                                                    Severity: Minor
                                                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                      Function _setSituationServices has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                        var _setSituationServices = function (sitnId, serviceList, primaryService)
                                                                                                                        {
                                                                                                                          debug('Entering _setSituationServices sitn_id:' + sitnId +
                                                                                                                            ' process_list:' + serviceList + ' [optional primary_process:' + primaryService + ']');
                                                                                                                          debug('_setSituationServices authToken: ' + opts.authToken);
                                                                                                                      Severity: Minor
                                                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                        Function _assignAlert has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                        Open

                                                                                                                          var _assignAlert = function (alertId, user)
                                                                                                                          {
                                                                                                                            debug('Entering _assignAlert');
                                                                                                                            debug('_assignAlert authToken: ' + opts.authToken);
                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                        Severity: Minor
                                                                                                                        Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                          Function _assignAndAcknowledgeSituation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                          Open

                                                                                                                            var _assignAndAcknowledgeSituation = function (sitnId, user)
                                                                                                                            {
                                                                                                                              debug('Entering _assignAndAcknowledgeSituation');
                                                                                                                              debug('_assignAndAcknowledgeSituation authToken: ' + opts.authToken);
                                                                                                                              return new Promise(function (resolve, reject)
                                                                                                                          Severity: Minor
                                                                                                                          Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                            Function _assignSituation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                              var _assignSituation = function (sitnId, user)
                                                                                                                              {
                                                                                                                                debug('Entering _assignSituation');
                                                                                                                                debug('_assignSituation authToken: ' + opts.authToken);
                                                                                                                                return new Promise(function (resolve, reject)
                                                                                                                            Severity: Minor
                                                                                                                            Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                              Function _assignAndAcknowledgeAlert has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                              Open

                                                                                                                                var _assignAndAcknowledgeAlert = function (alertId, user)
                                                                                                                                {
                                                                                                                                  debug('Entering _assignAndAcknowledgeAlert');
                                                                                                                                  debug('_assignAndAcknowledgeAlert authToken: ' + opts.authToken);
                                                                                                                                  return new Promise(function (resolve, reject)
                                                                                                                              Severity: Minor
                                                                                                                              Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                Function _createMaintenanceWindow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                  var _createMaintenanceWindow = function (maintObj)
                                                                                                                                  {
                                                                                                                                    debug('Entering _createMaintenanceWindow');
                                                                                                                                    debug('_createMaintenanceWindow authToken: ' + opts.authToken);
                                                                                                                                    return new Promise(function (resolve, reject)
                                                                                                                                Severity: Minor
                                                                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                  Function _createTeam has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                  Open

                                                                                                                                    var _createTeam = function (teamObj)
                                                                                                                                    {
                                                                                                                                      debug('Entering _createTeam');
                                                                                                                                      debug('_createTeam authToken: ' + opts.authToken);
                                                                                                                                      delete(teamObj.teamId);
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                    Function _updateTeam has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                    Open

                                                                                                                                      var _updateTeam = function (teamObj)
                                                                                                                                      {
                                                                                                                                        debug('Entering _updateTeam');
                                                                                                                                        return new Promise(function (resolve, reject)
                                                                                                                                        {
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                      Function _mergeSituations has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                      Open

                                                                                                                                        var _mergeSituations = function (situations, supersedeOriginal)
                                                                                                                                        {
                                                                                                                                          debug('Entering _mergeSituations situations:' + situations +
                                                                                                                                            ' supersede_original:' + supersedeOriginal);
                                                                                                                                          debug('_mergeSituations authToken: ' + opts.authToken);
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                        Function _setAlertSeverity has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                        Open

                                                                                                                                          var _setAlertSeverity = function (alertId, severity)
                                                                                                                                          {
                                                                                                                                            debug('Entering _setAlertSeverity alert:' + alertId +
                                                                                                                                              ' severity:' + severity);
                                                                                                                                            debug('_setAlertSeverity authToken: ' + opts.authToken);
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                          Function _addSigCorrelationInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                            var _addSigCorrelationInfo = function (sitnId, serviceName, resourceId)
                                                                                                                                            {
                                                                                                                                              debug('Entering _addSigCorrelationInfo sitn_id:' + sitnId +
                                                                                                                                                ' service_name:' + serviceName + ' resource_id:' + resourceId);
                                                                                                                                              debug('_addSigCorrelationInfo authToken: ' + opts.authToken);
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                            Function _setSituationDescription has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                              var _setSituationDescription = function (sitnId, description)
                                                                                                                                              {
                                                                                                                                                debug('Entering _setSituationDescription situation:' + sitnId +
                                                                                                                                                  ' description:' + description);
                                                                                                                                                debug('_setSituationDescription authToken: ' + opts.authToken);
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                              Function _removeAlertFromSituation has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                              Open

                                                                                                                                                var _removeAlertFromSituation = function (alertId, sitnId)
                                                                                                                                                {
                                                                                                                                                  debug('Entering _removeAlertFromSituation situation:' + sitnId +
                                                                                                                                                    ' alert:' + alertId);
                                                                                                                                                  debug('_removeAlertFromSituation authToken: ' + opts.authToken);
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                Function _setSituationExternalSeverity has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                Open

                                                                                                                                                  var _setSituationExternalSeverity = function (sitnId, severity)
                                                                                                                                                  {
                                                                                                                                                    debug('Entering _setSituationExternalSeverity situation:' + sitnId +
                                                                                                                                                      ' severity:' + severity);
                                                                                                                                                    debug('_setSituationExternalSeverity authToken: ' + opts.authToken);
                                                                                                                                                Severity: Minor
                                                                                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                  Function _setAlertAcknowledgeState has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                  Open

                                                                                                                                                    var _setAlertAcknowledgeState = function (alertId, acknowledged)
                                                                                                                                                    {
                                                                                                                                                      debug('Entering _setAlertAcknowledgeState alert:' + alertId +
                                                                                                                                                        ' acknowledged:' + acknowledged);
                                                                                                                                                      debug('_setAlertAcknowledgeState authToken: ' + opts.authToken);
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                    Function _setSituationAcknowledgeState has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                    Open

                                                                                                                                                      var _setSituationAcknowledgeState = function (sitnId, acknowledged)
                                                                                                                                                      {
                                                                                                                                                        debug('Entering _setSituationAcknowledgeState situation:' + sitnId +
                                                                                                                                                          ' acknowledged:' + acknowledged);
                                                                                                                                                        debug('_setSituationAcknowledgeState authToken: ' + opts.authToken);
                                                                                                                                                    Severity: Minor
                                                                                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                      Function _addThreadEntry has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                      Open

                                                                                                                                                        var _addThreadEntry = function (sitnId, threadName, entry)
                                                                                                                                                        {
                                                                                                                                                          debug('Entering _addThreadEntry sitn_id:' + sitnId);
                                                                                                                                                          debug('_addThreadEntry authToken: ' + opts.authToken);
                                                                                                                                                          return new Promise(function (resolve, reject)
                                                                                                                                                      Severity: Minor
                                                                                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                        Function _addAlertToSituation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                        Open

                                                                                                                                                          var _addAlertToSituation = function (alertId, sitnId)
                                                                                                                                                          {
                                                                                                                                                            debug('Entering _addAlertToSituation alert_id:' + alertId + ' sitn_id:' + sitnId);
                                                                                                                                                            debug('_addAlertToSituation authToken: ' + opts.authToken);
                                                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                                                        Severity: Minor
                                                                                                                                                        Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                          Function _addAlertCustomInfo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                          Open

                                                                                                                                                            var _addAlertCustomInfo = function (alertId, customInfo)
                                                                                                                                                            {
                                                                                                                                                              debug('Entering _addAlertCustomInfo');
                                                                                                                                                              debug('_addAlertCustomInfo authToken: ' + opts.authToken);
                                                                                                                                                              return new Promise(function (resolve, reject)
                                                                                                                                                          Severity: Minor
                                                                                                                                                          Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                            Function _createThread has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                            Open

                                                                                                                                                              var _createThread = function (sitnId, threadName)
                                                                                                                                                              {
                                                                                                                                                                debug('Entering _createThread sitn_id:' + sitnId);
                                                                                                                                                                debug('_createThread authToken: ' + opts.authToken);
                                                                                                                                                                return new Promise(function (resolve, reject)
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                              Function _addService has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                var _addService = function (name, description)
                                                                                                                                                                {
                                                                                                                                                                  debug('Entering _addService');
                                                                                                                                                                  debug('_addService authToken: ' + opts.authToken);
                                                                                                                                                                  return new Promise(function (resolve, reject)
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                Function _closeSituation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                  var _closeSituation = function (sitnId, resolution)
                                                                                                                                                                  {
                                                                                                                                                                    debug('Entering _closeSituation sitn_id:' + sitnId);
                                                                                                                                                                    debug('_closeSituation authToken: ' + opts.authToken);
                                                                                                                                                                    return new Promise(function (resolve, reject)
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                  Function _resolveSituation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                  Open

                                                                                                                                                                    var _resolveSituation = function (sitnId)
                                                                                                                                                                    {
                                                                                                                                                                      debug('Entering _resolveSituation situation:' + sitnId);
                                                                                                                                                                      debug('_resolveSituation authToken: ' + opts.authToken);
                                                                                                                                                                      return new Promise(function (resolve, reject)
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                    Function _addProcess has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                    Open

                                                                                                                                                                      var _addProcess = function (name, description)
                                                                                                                                                                      {
                                                                                                                                                                        debug('Entering _addProcess');
                                                                                                                                                                        debug('_addProcess authToken: ' + opts.authToken);
                                                                                                                                                                        return new Promise(function (resolve, reject)
                                                                                                                                                                    Severity: Minor
                                                                                                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                      Function _addSituationCustomInfo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                      Open

                                                                                                                                                                        var _addSituationCustomInfo = function (sitnId, customInfo)
                                                                                                                                                                        {
                                                                                                                                                                          debug('Entering _addSituationCustomInfo sitn_id:' + sitnId);
                                                                                                                                                                          debug('_addSituationCustomInfo authToken: ' + opts.authToken);
                                                                                                                                                                          return new Promise(function (resolve, reject)
                                                                                                                                                                      Severity: Minor
                                                                                                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                        Function _findMaintenanceWindows has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                        Open

                                                                                                                                                                          var _findMaintenanceWindows = function (filter, limit)
                                                                                                                                                                          {
                                                                                                                                                                            debug('Entering _findMaintenanceWindows');
                                                                                                                                                                            debug('_findMaintenanceWindows authToken: ' + opts.authToken);
                                                                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                          Function _createSituation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                          Open

                                                                                                                                                                            var _createSituation = function (description)
                                                                                                                                                                            {
                                                                                                                                                                              debug('Entering _createSituation description:' + description);
                                                                                                                                                                              debug('_createSituation authToken: ' + opts.authToken);
                                                                                                                                                                              return new Promise(function (resolve, reject)
                                                                                                                                                                          Severity: Minor
                                                                                                                                                                          Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                            Function _deassignAlert has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                            Open

                                                                                                                                                                              var _deassignAlert = function (alertId)
                                                                                                                                                                              {
                                                                                                                                                                                debug('Entering _deassignAlert');
                                                                                                                                                                                debug('_deassignAlert authToken: ' + opts.authToken);
                                                                                                                                                                                return new Promise(function (resolve, reject)
                                                                                                                                                                            Severity: Minor
                                                                                                                                                                            Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                              Function _deleteMaintenanceWindows has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                var _deleteMaintenanceWindows = function (filter, limit)
                                                                                                                                                                                {
                                                                                                                                                                                  debug('Entering _deleteMaintenanceWindows');
                                                                                                                                                                                  debug('_deleteMaintenanceWindows authToken: ' + opts.authToken);
                                                                                                                                                                                  return new Promise(function (resolve, reject)
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                                Function _closeAlert has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                                Open

                                                                                                                                                                                  var _closeAlert = function (alertId)
                                                                                                                                                                                  {
                                                                                                                                                                                    debug('Entering _closeAlert');
                                                                                                                                                                                    debug('_closeAlert authToken: ' + opts.authToken);
                                                                                                                                                                                    return new Promise(function (resolve, reject)
                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                                  Function _deleteMaintenanceWindow has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                                  Open

                                                                                                                                                                                    var _deleteMaintenanceWindow = function (window)
                                                                                                                                                                                    {
                                                                                                                                                                                      debug('Entering _deleteMaintenanceWindow');
                                                                                                                                                                                      debug('_deleteMaintenanceWindow authToken: ' + opts.authToken);
                                                                                                                                                                                      return new Promise(function (resolve, reject)
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                                    Function _deassignSituation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                                    Open

                                                                                                                                                                                      var _deassignSituation = function (sitnId)
                                                                                                                                                                                      {
                                                                                                                                                                                        debug('Entering _deassignSituation');
                                                                                                                                                                                        debug('_deassignSituation authToken: ' + opts.authToken);
                                                                                                                                                                                        return new Promise(function (resolve, reject)
                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                    Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                                      Function Graze has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      function Graze(grazeOpts)
                                                                                                                                                                                      {
                                                                                                                                                                                        if (!(this instanceof Graze))
                                                                                                                                                                                        {
                                                                                                                                                                                          return new Graze(grazeOpts);
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in lib/moog-graze.js - About 1 hr to fix

                                                                                                                                                                                        Function setSituationProcesses has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationProcesses = function (sitnId, processList, primaryProcess, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationProcesses");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.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 setSituationServices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationServices = function (sitnId, serviceList, primaryService, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationServices");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.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 assignAndAcknowledgeAlert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignAndAcknowledgeAlert = function (alertId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignAndAcknowledgeAlert");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.js - About 45 mins 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 assignSituation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignSituation = function (sitnId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.js - About 45 mins 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 assignAlert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignAlert = function (alertId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignAlert");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.js - About 45 mins 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 assignAndAcknowledgeSituation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignAndAcknowledgeSituation = function (sitnId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignAndAcknowledgeSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.js - About 45 mins 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 setOps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setOps = function (opts)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug('Entering setOps');
                                                                                                                                                                                          var localOps = opts || {};
                                                                                                                                                                                          var keysUpdated = 0;
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in lib/moog-graze.js - About 25 mins 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

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationServices = function (sitnId, serviceList, primaryService, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationServices");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3939..4024

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 649.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationProcesses = function (sitnId, processList, primaryProcess, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationProcesses");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 4033..4118

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 649.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignAlert = function (alertId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignAlert");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 3 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 1012..1086
                                                                                                                                                                                        lib/moog-graze.js on lines 1094..1168
                                                                                                                                                                                        lib/moog-graze.js on lines 1176..1250

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 604.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignAndAcknowledgeAlert = function (alertId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignAndAcknowledgeAlert");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 3 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 930..1004
                                                                                                                                                                                        lib/moog-graze.js on lines 1094..1168
                                                                                                                                                                                        lib/moog-graze.js on lines 1176..1250

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 604.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignAndAcknowledgeSituation = function (sitnId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignAndAcknowledgeSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 3 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 930..1004
                                                                                                                                                                                        lib/moog-graze.js on lines 1012..1086
                                                                                                                                                                                        lib/moog-graze.js on lines 1176..1250

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 604.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.assignSituation = function (sitnId, user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering assignSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 3 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 930..1004
                                                                                                                                                                                        lib/moog-graze.js on lines 1012..1086
                                                                                                                                                                                        lib/moog-graze.js on lines 1094..1168

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 604.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setAlertAcknowledgeState = function (alertId, acknowledged, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setAlertAcknowledgeState");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3408..3476
                                                                                                                                                                                        lib/moog-graze.js on lines 3633..3702
                                                                                                                                                                                        lib/moog-graze.js on lines 3710..3778
                                                                                                                                                                                        lib/moog-graze.js on lines 3786..3854
                                                                                                                                                                                        lib/moog-graze.js on lines 3862..3930

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 549.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationAcknowledgeState = function (sitnId, acknowledged, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationAcknowledgeState");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3408..3476
                                                                                                                                                                                        lib/moog-graze.js on lines 3557..3625
                                                                                                                                                                                        lib/moog-graze.js on lines 3633..3702
                                                                                                                                                                                        lib/moog-graze.js on lines 3786..3854
                                                                                                                                                                                        lib/moog-graze.js on lines 3862..3930

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 549.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationExternalSeverity = function (sitnId, severity, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationExternalSeverity **WARNING** Deprecated 5.2.3+");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3408..3476
                                                                                                                                                                                        lib/moog-graze.js on lines 3557..3625
                                                                                                                                                                                        lib/moog-graze.js on lines 3633..3702
                                                                                                                                                                                        lib/moog-graze.js on lines 3710..3778
                                                                                                                                                                                        lib/moog-graze.js on lines 3786..3854

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 549.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.removeAlertFromSituation = function (alertId, sitnId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering removeAlertFromSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3557..3625
                                                                                                                                                                                        lib/moog-graze.js on lines 3633..3702
                                                                                                                                                                                        lib/moog-graze.js on lines 3710..3778
                                                                                                                                                                                        lib/moog-graze.js on lines 3786..3854
                                                                                                                                                                                        lib/moog-graze.js on lines 3862..3930

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 549.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setAlertSeverity = function (alertId, severity, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setAlertSeverity");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3408..3476
                                                                                                                                                                                        lib/moog-graze.js on lines 3557..3625
                                                                                                                                                                                        lib/moog-graze.js on lines 3710..3778
                                                                                                                                                                                        lib/moog-graze.js on lines 3786..3854
                                                                                                                                                                                        lib/moog-graze.js on lines 3862..3930

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 549.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.setSituationDescription = function (sitnId, description, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering setSituationDescription");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3408..3476
                                                                                                                                                                                        lib/moog-graze.js on lines 3557..3625
                                                                                                                                                                                        lib/moog-graze.js on lines 3633..3702
                                                                                                                                                                                        lib/moog-graze.js on lines 3710..3778
                                                                                                                                                                                        lib/moog-graze.js on lines 3862..3930

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 549.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.createThread = function (sitnId, threadName, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering createThread");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 782..847
                                                                                                                                                                                        lib/moog-graze.js on lines 1329..1394

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 530.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.addSituationCustomInfo = function (sitnId, customInfo, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering addSituationCustomInfo");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 1329..1394
                                                                                                                                                                                        lib/moog-graze.js on lines 1473..1538

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 530.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.closeSituation = function (sitnId, resolution, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering closeSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 782..847
                                                                                                                                                                                        lib/moog-graze.js on lines 1473..1538

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 530.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.addProcess = function (name, description, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering addProcess");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 633..698

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 526.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.addService = function (name, description, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering addService");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 560..625

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 526.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.deassignAlert = function (alertId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering deassignAlert");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 1953..2016

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 516.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.deassignSituation = function (sitnId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering deassignSituation");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 1882..1946

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 516.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.deleteMaintenanceWindows = function (filter, limit, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering deleteMaintenanceWindows");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2165..2228

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 515.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.findMaintenanceWindows = function (filter, limit, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering findMaintenanceWindows");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 3 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2094..2157

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 515.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.closeAlert = function (alertId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering closeAlert");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2023..2086

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 512.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.deleteMaintenanceWindow = function (window, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering deleteMaintenanceWindow");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 1257..1321

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 512.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getUserRoles = function (user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getUserRoles");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2837..2897

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 467.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getUserTeams = function (user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getUserTeams");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2770..2830

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 467.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationAlertIds = function (sitnId, uniqueOnly, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationAlertIds");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 3084..3137

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 458.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationHosts = function (sitnId, uniqueOnly, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationHosts");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2905..2958

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 458.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationIds = function (query, limit, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationIds");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2353..2405
                                                                                                                                                                                        lib/moog-graze.js on lines 2413..2465

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 451.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getAlertIds = function (query, limit, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getAlertIds");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2413..2465
                                                                                                                                                                                        lib/moog-graze.js on lines 3145..3196

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 451.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getMaintenanceWindows = function (start, limit, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getMaintenanceWindows");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2353..2405
                                                                                                                                                                                        lib/moog-graze.js on lines 3145..3196

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 451.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationServices = function (sitnId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationServices");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2293..2345
                                                                                                                                                                                        lib/moog-graze.js on lines 2710..2763
                                                                                                                                                                                        lib/moog-graze.js on lines 2965..3017
                                                                                                                                                                                        lib/moog-graze.js on lines 3024..3076
                                                                                                                                                                                        lib/moog-graze.js on lines 3203..3255

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 436.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationDetails = function (sitnId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationDetails");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2293..2345
                                                                                                                                                                                        lib/moog-graze.js on lines 2710..2763
                                                                                                                                                                                        lib/moog-graze.js on lines 2965..3017
                                                                                                                                                                                        lib/moog-graze.js on lines 3203..3255
                                                                                                                                                                                        lib/moog-graze.js on lines 3262..3314

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 436.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationDescription = function (sitnId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationDescription");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2293..2345
                                                                                                                                                                                        lib/moog-graze.js on lines 2710..2763
                                                                                                                                                                                        lib/moog-graze.js on lines 3024..3076
                                                                                                                                                                                        lib/moog-graze.js on lines 3203..3255
                                                                                                                                                                                        lib/moog-graze.js on lines 3262..3314

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 436.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getAlertDetails = function (alertId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getAlertDetails");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2710..2763
                                                                                                                                                                                        lib/moog-graze.js on lines 2965..3017
                                                                                                                                                                                        lib/moog-graze.js on lines 3024..3076
                                                                                                                                                                                        lib/moog-graze.js on lines 3203..3255
                                                                                                                                                                                        lib/moog-graze.js on lines 3262..3314

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 436.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSituationProcesses = function (sitnId, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSituationProcesses");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2293..2345
                                                                                                                                                                                        lib/moog-graze.js on lines 2710..2763
                                                                                                                                                                                        lib/moog-graze.js on lines 2965..3017
                                                                                                                                                                                        lib/moog-graze.js on lines 3024..3076
                                                                                                                                                                                        lib/moog-graze.js on lines 3262..3314

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 436.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getUserInfo = function (user, callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getUserInfo");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 5 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2293..2345
                                                                                                                                                                                        lib/moog-graze.js on lines 2965..3017
                                                                                                                                                                                        lib/moog-graze.js on lines 3024..3076
                                                                                                                                                                                        lib/moog-graze.js on lines 3203..3255
                                                                                                                                                                                        lib/moog-graze.js on lines 3262..3314

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 436.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSystemStatus = function (callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSystemStatus");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2234..2286
                                                                                                                                                                                        lib/moog-graze.js on lines 2529..2581

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 425.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getSystemSummary = function (callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getSystemSummary");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2234..2286
                                                                                                                                                                                        lib/moog-graze.js on lines 2471..2523

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 425.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                        Graze.prototype.getActiveSituationIds = function (callback)
                                                                                                                                                                                        {
                                                                                                                                                                                          debug("Entering getActiveSituationIds");
                                                                                                                                                                                          var opts = this.connectOptions;
                                                                                                                                                                                          var self = this;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 2 other locations - About 2 days to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 2471..2523
                                                                                                                                                                                        lib/moog-graze.js on lines 2529..2581

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 425.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                                                                                            {
                                                                                                                                                                                        
                                                                                                                                                                                              var grazePath = opts.grazeBasePath + "/updateTeam";
                                                                                                                                                                                        
                                                                                                                                                                                        
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 1 day to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 1582..1620

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 330.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                                                                                            {
                                                                                                                                                                                        
                                                                                                                                                                                              var grazePath = opts.grazeBasePath + "/createMaintenanceWindow";
                                                                                                                                                                                        
                                                                                                                                                                                        
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 1 day to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 4133..4171

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 330.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                                                                                            {
                                                                                                                                                                                        
                                                                                                                                                                                              var grazePath = opts.grazeBasePath + "/addSigCorrelationInfo";
                                                                                                                                                                                        
                                                                                                                                                                                        
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 1 day to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 866..899

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 239.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                            return new Promise(function (resolve, reject)
                                                                                                                                                                                            {
                                                                                                                                                                                        
                                                                                                                                                                                              var grazePath = opts.grazeBasePath + "/addThreadEntry";
                                                                                                                                                                                        
                                                                                                                                                                                        
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in lib/moog-graze.js and 1 other location - About 1 day to fix
                                                                                                                                                                                        lib/moog-graze.js on lines 718..751

                                                                                                                                                                                        Duplicated Code

                                                                                                                                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                        Tuning

                                                                                                                                                                                        This issue has a mass of 239.

                                                                                                                                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                        Refactorings

                                                                                                                                                                                        Further Reading

                                                                                                                                                                                        There are no issues that match your filters.

                                                                                                                                                                                        Category
                                                                                                                                                                                        Status