meteor/meteor

View on GitHub
tools/runners/run-app.js

Summary

Maintainability
F
1 wk
Test Coverage

Function _runOnce has 334 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _runOnce: function (options) {
    var self = this;
    options = options || {};
    var firstRun = options.firstRun;

Severity: Major
Found in tools/runners/run-app.js - About 1 day to fix

    File run-app.js has 684 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var _ = require('underscore');
    var Fiber = require('fibers');
    var files = require('../fs/files');
    var watch = require('../fs/watch');
    var bundler = require('../isobuild/bundler.js');
    Severity: Major
    Found in tools/runners/run-app.js - About 1 day to fix

      Function _runOnce has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
      Open

        _runOnce: function (options) {
          var self = this;
          options = options || {};
          var firstRun = options.firstRun;
      
      
      Severity: Minor
      Found in tools/runners/run-app.js - About 1 day 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 _fiber has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

        _fiber: function () {
          var self = this;
          var firstRun = true;
      
          while (true) {
      Severity: Minor
      Found in tools/runners/run-app.js - About 5 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 bundleApp has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var bundleApp = function () {
            if (! firstRun) {
              // If the build fails in a way that could be fixed by a refresh, allow
              // it even if we refreshed previously, since that might have been a
              // little while ago.
      Severity: Major
      Found in tools/runners/run-app.js - About 3 hrs to fix

        Function _fiber has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _fiber: function () {
            var self = this;
            var firstRun = true;
        
            while (true) {
        Severity: Major
        Found in tools/runners/run-app.js - About 3 hrs to fix

          Function _computeEnvironment has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _computeEnvironment: function () {
              var self = this;
              var env = Object.assign({}, process.env);
          
              env.PORT = self.port;
          Severity: Major
          Found in tools/runners/run-app.js - About 2 hrs to fix

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

              _computeEnvironment: function () {
                var self = this;
                var env = Object.assign({}, process.env);
            
                env.PORT = self.port;
            Severity: Minor
            Found in tools/runners/run-app.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 AppRunner has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var AppRunner = function (options) {
              var self = this;
            
              self.projectContext = options.projectContext;
            
            
            Severity: Minor
            Found in tools/runners/run-app.js - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                      if (postStartupResult) return postStartupResult;
              Severity: Major
              Found in tools/runners/run-app.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return bundleResultOrRunResult.runResult;
                Severity: Major
                Found in tools/runners/run-app.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return ret;
                  Severity: Major
                  Found in tools/runners/run-app.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return true;
                    Severity: Major
                    Found in tools/runners/run-app.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return { outcome: 'stopped' };
                      Severity: Major
                      Found in tools/runners/run-app.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            if (postStartupResult) return postStartupResult;
                        Severity: Major
                        Found in tools/runners/run-app.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return { bundleResult: bundleResult };
                          Severity: Major
                          Found in tools/runners/run-app.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                      return { outcome: 'outdated-cordova-plugins' };
                            Severity: Major
                            Found in tools/runners/run-app.js - About 30 mins to fix

                              There are no issues that match your filters.

                              Category
                              Status