Moogsoft/moog-graze

View on GitHub

Showing 141 of 141 total issues

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

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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language