marcells/node-build-monitor

View on GitHub

Showing 110 of 159 total issues

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

  const getPreviousBuilds = (currentBuilds, callback) => {
    async.map(previousBuildsToGet, (build, callback) => {
      let def = build.definition;

      // If we already have a previous build, then we don't need to get another one
Severity: Minor
Found in app/services/Tfs.js - About 1 hr to fix

    Function BuildMonitorServer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var BuildMonitorServer = function () {
            var self = this,
                cachedSettings;
    
            this.connect = function () {
    Severity: Minor
    Found in app/public/scripts/BuildMonitorServer.js - About 1 hr to fix

      Function formatWorkflow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          formatWorkflow = function (buildsGroup) {
            const { vcs, username, project } = self.configuration;
      
            if (buildsGroup.some(build => build.in_workflow=== false)) {
              return buildsGroup.map(build => self.formatBuild(build));
      Severity: Minor
      Found in app/services/CircleCI.js - About 1 hr to fix

        Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function () {
            var self = this,
                requestBuilds = function (callback) {
                    bitriseRequest(
                        '/apps/' + self.configuration.slug + '/builds',
        Severity: Minor
        Found in app/services/Bitrise.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

        Avoid deeply nested control flow statements.
        Open

                                    if (cause && cause.userName) {
                                        return cause.userName;
                                    }
        Severity: Major
        Found in app/services/Jenkins.js - About 45 mins to fix

          Avoid too many return statements within this function.
          Open

                      return "Green";
          Severity: Major
          Found in app/services/BambooDeploy.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return statusText + "/" + resultText;
            Severity: Major
            Found in app/services/Tfs2015.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          if (statusText === "IN_PROGRESS") return "Blue";
              Severity: Major
              Found in app/services/BitbucketPipelines.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            if (result === null) return "Blue";
                Severity: Major
                Found in app/services/Jenkins.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                    return -1;
                  Severity: Major
                  Found in app/services/TfsRelease.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return 0;
                    Severity: Major
                    Found in app/services/TfsRelease.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                if (statusText === "PENDING") return "Pending";
                      Severity: Major
                      Found in app/services/BitbucketPipelines.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  if (statusText === "IN_PROGRESS") return "In Progress";
                        Severity: Major
                        Found in app/services/BitbucketPipelines.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                    if (lifeCycleState === 'NotBuilt') return 'Gray';
                          Severity: Major
                          Found in app/services/Bamboo.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        if (result === 'ABORTED') return "Gray";
                            Severity: Major
                            Found in app/services/Jenkins.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          if (result === 'NOT_BUILT') return "Running";
                              Severity: Major
                              Found in app/services/Jenkins.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            if (result === 'ABORTED') return "Aborted";
                                Severity: Major
                                Found in app/services/Jenkins.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              if (statusText === "stopped") return "Gray";
                                  Severity: Major
                                  Found in app/services/Tfs2015.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                if (build.status === "ERROR") return "Error";
                                    Severity: Major
                                    Found in app/services/TeamCity.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return 'Paused';
                                      Severity: Major
                                      Found in app/services/PRTG.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language