marcells/node-build-monitor

View on GitHub

Showing 159 of 159 total issues

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

module.exports = function () {
    var self = this,
        makeUrl = function (url, odata) {
            var baseUrl = self.configuration.url + '/_apis/build' + url;

Severity: Major
Found in app/services/Tfs2015.js - About 3 hrs to fix

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

    module.exports = function () {
        var self = this,
            tryGetTfsProxyUrlOfDocker = function () {
                return 'http://' +
                    process.env.TFS_PROXY_PORT_4567_TCP_ADDR +
    Severity: Major
    Found in app/services/TfsProxy.js - About 3 hrs to fix

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

              getStatus = function (state, lifeCycleState) {
                  if (state === 'STARTED') return "Blue";
                  if (state === 'FINISHED') return "Blue";
                  if (state === 'CANCELLED') return "Gray";
                  if (state === 'FAILED') return "Red";
      Severity: Major
      Found in app/services/BambooDeploy.js and 1 other location - About 2 hrs to fix
      app/services/Bamboo.js on lines 94..104

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

      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(state, lifeCycleState) {
              if (state === 'started') return "Blue";
              if (state === 'created') return "Blue";
              if (state === 'canceled') return "Gray";
              if (state === 'Failed') return "Red";
      Severity: Major
      Found in app/services/Bamboo.js and 1 other location - About 2 hrs to fix
      app/services/BambooDeploy.js on lines 96..106

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

      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 a Cognitive Complexity of 21 (exceeds 5 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: Minor
      Found in app/services/Drone.js - About 2 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 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function () {
          var self = this,
              getBuilds = function(callback) {
                  makeRequest(self.config.url, function(err, result) {
                      if (err) {
      Severity: Major
      Found in app/services/CCTray.js - About 2 hrs to fix

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

        module.exports = function () {
            var self = this,
                makeUrl = function () {
                    return 'https://api.bitbucket.org/2.0/repositories/' + (self.configuration.teamname || self.configuration.username) + '/' + self.configuration.slug + '/pipelines/?sort=-created_on&pagelen=1';
                },
        Severity: Major
        Found in app/services/BitbucketPipelines.js - About 2 hrs to fix

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

          module.exports = function () {
              var self = this;
          
              self.configuration = {
                  interval: 5000,
          Severity: Major
          Found in app/monitor.js - About 2 hrs to fix

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

                var BuildViewModel = function (build) {
                    this.isMenuVisible = ko.observable(false);
            
                    this.id = ko.observable();
                    this.isRunning = ko.observable();
            Severity: Major
            Found in app/public/scripts/BuildViewModel.js - About 2 hrs to fix

              Function exports has a Cognitive Complexity of 19 (exceeds 5 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: Minor
              Found in app/services/Travis.js - About 2 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 transformData has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  const transformData = (err, body, callback) => {
                    if (err) {
                      callback(err);
                      return;
                    }
              Severity: Major
              Found in app/services/TfsRelease.js - About 2 hrs to fix

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

                    if (typeof self.configuration.caPath !== "undefined") {
                      request = request.defaults({
                        agentOptions: {
                          ca: require("fs")
                            .readFileSync(self.configuration.caPath)
                Severity: Major
                Found in app/services/CircleCI.js and 3 other locations - About 2 hrs to fix
                app/services/Drone.js on lines 131..140
                app/services/GitLab.js on lines 228..234
                app/services/Travis.js on lines 78..84

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

                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

                    if (typeof self.configuration.caPath !== "undefined") {
                      request = request.defaults({
                        agentOptions: {
                          ca: require("fs")
                            .readFileSync(self.configuration.caPath)
                Severity: Major
                Found in app/services/Drone.js and 3 other locations - About 2 hrs to fix
                app/services/CircleCI.js on lines 211..220
                app/services/GitLab.js on lines 228..234
                app/services/Travis.js on lines 78..84

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

                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

                        if (typeof self.configuration.caPath !== 'undefined') {
                            request = request.defaults({
                                agentOptions: {
                                    ca: require('fs').readFileSync(self.configuration.caPath).toString().split("\n\n")
                                }
                Severity: Major
                Found in app/services/Travis.js and 3 other locations - About 2 hrs to fix
                app/services/CircleCI.js on lines 211..220
                app/services/Drone.js on lines 131..140
                app/services/GitLab.js on lines 228..234

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

                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

                        if (typeof self.config.caPath !== 'undefined') {
                            request = request.defaults({
                                agentOptions: {
                                    ca: require('fs').readFileSync(self.config.caPath).toString().split("\n\n")
                                }
                Severity: Major
                Found in app/services/GitLab.js and 3 other locations - About 2 hrs to fix
                app/services/CircleCI.js on lines 211..220
                app/services/Drone.js on lines 131..140
                app/services/Travis.js on lines 78..84

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

                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

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

                        makeRequest = function (url, callback) {
                          request.makeRequest({
                            authentication: self.configuration.authentication,
                            url: url,
                            username: self.configuration.username,
                Severity: Major
                Found in app/services/Tfs2015.js and 1 other location - About 2 hrs to fix
                app/services/TeamCity.js on lines 43..51

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

                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

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

                        makeRequest = function (url, callback) {
                          request.makeRequest({
                            authentication: self.configuration.authentication,
                            url: url,
                            username: self.configuration.username,
                Severity: Major
                Found in app/services/TeamCity.js and 1 other location - About 2 hrs to fix
                app/services/Tfs2015.js on lines 14..22

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

                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

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

                        getAuthors = function (reason) {
                            var urlRegex = /<a[^>]*>([\s\S]*?)<\/a>/g;
                            var links = reason.match(urlRegex);
                            if (links !== null) {
                                return links.map(
                Severity: Major
                Found in app/services/BambooDeploy.js and 1 other location - About 2 hrs to fix
                app/services/Bamboo.js on lines 82..93

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

                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

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

                    getAuthors = function(reason) {
                        var urlRegex = /<a[^>]*>([\s\S]*?)<\/a>/g;
                        var links = reason.match(urlRegex);
                        if (links !== null) {
                            return links.map(
                Severity: Major
                Found in app/services/Bamboo.js and 1 other location - About 2 hrs to fix
                app/services/BambooDeploy.js on lines 84..95

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

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

                    self.run = function () {
                        var allBuilds = [];
                
                        async.each(self.plugins, function (plugin, callback) {
                            log('Check for builds...', self.configuration.debug);
                Severity: Major
                Found in app/monitor.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language