meteor/meteor

View on GitHub
tools/static-assets/server/boot.js

Summary

Maintainability
D
1 day
Test Coverage

Function loadServerBundles has 153 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var loadServerBundles = Profile("Load server bundles", function () {
  var infos = [];

  serverJson.load.forEach(function (fileInfo) {
    var code = fs.readFileSync(path.resolve(serverDir, fileInfo.path));
Severity: Major
Found in tools/static-assets/server/boot.js - About 6 hrs to fix

    File boot.js has 348 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var Fiber = require("fibers");
    var fs = require("fs");
    var path = require("path");
    var Future = require("fibers/future");
    var sourcemap_support = require('source-map-support');
    Severity: Minor
    Found in tools/static-assets/server/boot.js - About 4 hrs to fix

      Function runMain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var runMain = Profile("Run main()", function () {
        // find and run main()
        // XXX hack. we should know the package that contains main.
        var mains = [];
        var globalMain;
      Severity: Minor
      Found in tools/static-assets/server/boot.js - About 1 hr to fix

        Function maybeWaitForDebuggerToAttach has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function maybeWaitForDebuggerToAttach() {
          if (meteorDebugFuture) {
            const { pause } = require("./debug");
            const pauseThresholdMs = 50;
            const pollIntervalMs = 500;
        Severity: Minor
        Found in tools/static-assets/server/boot.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 getAsset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var getAsset = function (assetPath, encoding, callback) {
              var promiseResolver, promise;
              if (! callback) {
                promise = new Promise((resolve, reject) => {
                  promiseResolver = function (error, result) {
        Severity: Minor
        Found in tools/static-assets/server/boot.js - About 1 hr to fix

          Function runMain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          var runMain = Profile("Run main()", function () {
            // find and run main()
            // XXX hack. we should know the package that contains main.
            var mains = [];
            var globalMain;
          Severity: Minor
          Found in tools/static-assets/server/boot.js - About 25 mins 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 startCheckForLiveParent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          var startCheckForLiveParent = function (parentPid) {
            if (parentPid) {
              if (! bootUtils.validPid(parentPid)) {
                console.error("METEOR_PARENT_PID must be a valid process ID.");
                process.exit(1);
          Severity: Minor
          Found in tools/static-assets/server/boot.js - About 25 mins 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

          There are no issues that match your filters.

          Category
          Status