marcells/node-build-monitor

View on GitHub

Showing 110 of 159 total issues

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

    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

      Function OptionsViewModel has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

        module.exports = function () {
            var self = this,
                tryGetTfsProxyUrlOfDocker = function () {
                    return 'http://' +
                        process.env.TFS_PROXY_PORT_4567_TCP_ADDR +
        Severity: Minor
        Found in app/services/TfsProxy.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 a Cognitive Complexity of 16 (exceeds 5 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: Minor
        Found in app/services/Shippable.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 result has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  const result = response.organization.pipelines.edges.map(x => {
                    const pipeline = x.node;
                    const build =
                      x.node.builds.edges.length > 0 ? 
                        x.node.builds.edges[0].node : {
        Severity: Minor
        Found in app/services/Buildkite.js - About 1 hr to fix

          Function makeRequest has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            makeRequest: function (opts, callback) {
              if (opts.authentication && opts.authentication.trim() === 'ntlm') {
                ntlm.get({
                  url: opts.url,
                  username: opts.username,
          Severity: Minor
          Found in app/requests.js - About 1 hr to fix

            Function transformer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                const transformer = (build) => {
                  let color = colorScheme[
                    build.result ?
                      resultFilter[build.result] :
                      (build.status === statusFilter.notStarted ?
            Severity: Minor
            Found in app/services/Tfs.js - About 1 hr to fix

              Function sortBuilds has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  sortBuilds = function (newBuilds, sortOrder, errorFirst) {
                      if(sortOrder == "project") {
                          newBuilds.sort(function (a, b) {
                              if(a.project > b.project) return 1;
                              if(a.project < b.project) return -1;
              Severity: Minor
              Found in app/monitor.js - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function () {
                  var self = this,
                      getBuilds = function(callback) {
                          makeRequest(self.config.url, function(err, result) {
                              if (err) {
              Severity: Minor
              Found in app/services/CCTray.js - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function() {
                var configuration = {};
                var graph;
              
                return {
              Severity: Minor
              Found in app/services/Buildkite.js - About 1 hr 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 getLatestBuildStep has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const getLatestBuildStep = (build, callback) => {
                  const timelineURL = build.timeline;
                  if (!timelineURL || timelineURL === '') {
                    console.log('no timeline url');
                    callback(null, build);
              Severity: Minor
              Found in app/services/Tfs.js - About 1 hr to fix

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

                module.exports = function(grunt) {
                  grunt.initConfig({
                    jshint: {
                      files: [ 'Gruntfile.js', 'app/*.js', 'app/services/*.js', 'app/public/scripts/*.js', 'test/**/*.js', '!test/**/scenario_*.js' ],
                      options: {
                Severity: Minor
                Found in Gruntfile.js - About 1 hr to fix

                  Function requestBuilds has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      requestBuilds = function (callback) {
                        const {
                          vcs,
                          username,
                          project,
                  Severity: Minor
                  Found in app/services/CircleCI.js - About 1 hr to fix

                    Function configure has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      self.configure = function (config) {
                        self.configuration = config;
                    
                        if (!self.configuration.slug) {
                          console.error(`[Drone] Please configure the [slug] parameter`);
                    Severity: Minor
                    Found in app/services/Drone.js - About 1 hr to fix

                      Function prioritySort has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              prioritySort = function (a, b)
                                    {
                                      if (b.hasErrors)      
                                      {
                                        return 1;
                      Severity: Minor
                      Found in app/services/TfsRelease.js - About 1 hr to fix

                        Function configure has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          self.configure = function(config) {
                            self.configuration = config;
                        
                            if (!self.configuration.vcs) {
                              console.error(`[CircleCI] Please configure the [vcs] parameter`);
                        Severity: Minor
                        Found in app/services/CircleCI.js - About 1 hr to fix

                          Function updateCurrentBuildsWithChanges has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  this.updateCurrentBuildsWithChanges = function (changes)  {
                                      if (anyBuildMatchesToNotifcationFilter(changes.removed) ||
                                          anyBuildMatchesToNotifcationFilter(changes.added) ||
                                          anyBuildMatchesToNotifcationFilter(changes.updated)) {
                                          self.setHasUnreadBuilds(true);
                          Severity: Minor
                          Found in app/public/scripts/AppViewModel.js - About 1 hr to fix

                            Function detectChanges has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                detectChanges = function (currentBuilds, newBuilds) {
                                    var changes = {
                                            added: [],
                                            removed: [],
                                            updated: []
                            Severity: Minor
                            Found in app/monitor.js - About 1 hr to fix

                              Function loadProjects has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      loadProjects = function(callback) {
                                          var slugs = self.config.slugs,
                                              matchers = slugs.map(slug => slug.project),
                                              findNamespaceIndexInMatchers = function(namespace) {
                                                  for(var i = 0; i < matchers.length; i++){
                              Severity: Minor
                              Found in app/services/GitLab.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language