marcells/node-build-monitor

View on GitHub

Showing 159 of 159 total issues

Function exports has 127 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function () {
  var self = this,
    requestBuilds = function (callback) {
      const url = `${self.api_base}/repos/${self.configuration.slug}/builds`;
      if (self.configuration.debug) {
Severity: Major
Found in app/services/Drone.js - About 5 hrs to fix

    Function exports has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function () {
        var self = this,
        queryBuilds = function (callback) {
            requestBuilds(function (error, body) {
                if (error) {
    Severity: Major
    Found in app/services/Bamboo.js - About 4 hrs to fix

      Function exports has 117 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function () {
          var self = this,
              queryBuilds = function (callback) {
                  fetchDeployments(function (error, body) {
                      if (error) {
      Severity: Major
      Found in app/services/BambooDeploy.js - About 4 hrs to fix

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

        module.exports = function () {
            var self = this,
                makeUrl = function (url, odata) {
                    var baseUrl = self.configuration.url + '/_apis/build' + url;
        
        
        Severity: Minor
        Found in app/services/Tfs2015.js - About 4 hrs 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 exports has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function () {
            var self = this,
                getSensors = function(callback) {
                    var url =  self.configuration.url +
                        '/api/getsensordetails.json?id=' + self.configuration.sensorId +
        Severity: Minor
        Found in app/services/PRTG.js - About 4 hrs 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 exports has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function () {
            var self = this,
                getRequestHeaders = function () { // build request header
                    if (typeof process.env.BUILDBUDDY_ACCESS_TOKEN !== 'undefined') {
                        self.configuration.access_token = process.env.BUILDBUDDY_ACCESS_TOKEN;
        Severity: Minor
        Found in app/services/BuddyBuild.js - About 4 hrs 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 getListOfRelease has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const getListOfRelease = (callback) => {
            if(!protocol) {
                protocol = "https";
            }
            
        Severity: Major
        Found in app/services/TfsRelease.js - About 4 hrs to fix

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

          module.exports = function () {
              var self = this,
                  queryBuilds = function (callback) {
                      fetchDeployments(function (error, body) {
                          if (error) {
          Severity: Minor
          Found in app/services/BambooDeploy.js - About 4 hrs 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 register has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.register = function () {
                  ko.forcibleComputed = function(readFunc, context, options) {
                      var trigger = ko.observable(),
                          target = ko.computed(function() {
                              trigger();
          Severity: Major
          Found in app/public/scripts/knockoutExtensions.js - About 4 hrs to fix

            Function AppViewModel has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var AppViewModel = function() {
                    var self = this;
            
                    var isLoadingInitially = true;
            
            
            Severity: Major
            Found in app/public/scripts/AppViewModel.js - About 4 hrs to fix

              Function check has 98 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  check: function(callback) {
                    graph
                      .query(
                        `
                    SimpleQuery {
              Severity: Major
              Found in app/services/Buildkite.js - About 3 hrs to fix

                Function exports has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function () {
                    var self = this,
                        getSensors = function(callback) {
                            var url =  self.configuration.url +
                                '/api/getsensordetails.json?id=' + self.configuration.sensorId +
                Severity: Major
                Found in app/services/PRTG.js - About 3 hrs to fix

                  Function exports has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function () {
                      var self = this,
                          getRequestHeaders = function () {
                              if (typeof process.env.SHIPPABLE_API_TOKEN !== 'undefined') {
                                  self.configuration.token = process.env.SHIPPABLE_API_TOKEN;
                  Severity: Major
                  Found in app/services/Shippable.js - About 3 hrs to fix

                    Function getListOfBuilds has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const getListOfBuilds = (callback) => {
                        const apiUrl = `${url}/${collection}/${project}/_apis/build/builds?api-version=${apiVersion}${params}`;
                        let options = {
                          url : apiUrl,
                          headers: {
                    Severity: Major
                    Found in app/services/Tfs.js - About 3 hrs to fix

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

                              getStatusText = function (build) {
                                  if (build.running) return "Running";
                                  if (build.canceledInfo) return "Canceled";
                                  if (build.failedToStart) return "Failed to Start";
                      
                      
                      Severity: Major
                      Found in app/services/TeamCity.js and 1 other location - About 3 hrs to fix
                      app/services/TeamCity.js on lines 116..127

                      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 107.

                      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

                              getStatus = function (build) {
                                  if (build.running) return "Blue";
                                  if (build.canceledInfo) return "Gray";
                                  if (build.failedToStart) return "Red";
                      
                      
                      Severity: Major
                      Found in app/services/TeamCity.js and 1 other location - About 3 hrs to fix
                      app/services/TeamCity.js on lines 128..139

                      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 107.

                      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 exports has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function () {
                          var self = this,
                              requestBuilds = function (callback) {
                                  bitriseRequest(
                                      '/apps/' + self.configuration.slug + '/builds',
                      Severity: Major
                      Found in app/services/Bitrise.js - About 3 hrs to fix

                        Function exports has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function () {
                            var self = this,
                                requestBuilds = function (callback) {
                                    request({
                                        'url': self.api_base + '/builds?access_token=' + self.configuration.token,
                        Severity: Major
                        Found in app/services/Travis.js - About 3 hrs to fix

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

                                  getStatusText = function (build) {
                                      if (build.building) return "Running";
                                      var result = build.result;
                                      if (result === 'FAILURE') return "Failure";
                                      if (result === 'SUCCESS') return "Success";
                          Severity: Major
                          Found in app/services/Jenkins.js and 1 other location - About 3 hrs to fix
                          app/services/Jenkins.js on lines 122..133

                          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 102.

                          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

                                  getStatus = function (build) {
                                      if (build.building) return "Blue";
                                      var result = build.result;
                                      if (result === 'FAILURE') return "Red";
                                      if (result === 'SUCCESS') return "Green";
                          Severity: Major
                          Found in app/services/Jenkins.js and 1 other location - About 3 hrs to fix
                          app/services/Jenkins.js on lines 134..145

                          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 102.

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language