marcells/node-build-monitor

View on GitHub

Showing 110 of 159 total issues

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

                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

                    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

                        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

                                Severity
                                Category
                                Status
                                Source
                                Language