meteor/meteor

View on GitHub
tools/cli/dev-bundle.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function getDevBundleForRelease has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getDevBundleForRelease(release) {
  var parts = release.split("@");
  if (parts.length < 2) {
    return null;
  }
Severity: Major
Found in tools/cli/dev-bundle.js - About 2 hrs to fix

    Function getDevBundleDir has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getDevBundleDir() {
      // Note that this code does not care if we are running meteor from a
      // checkout, because it's always better to respect the .meteor/release
      // file of the current app, if possible.
    
    
    Severity: Minor
    Found in tools/cli/dev-bundle.js - About 1 hr to fix

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

      function statOrNull(path, statMethod) {
        try {
          var stat = fs.statSync(path);
        } catch (e) {
          if (e.code !== "ENOENT") {
      Severity: Minor
      Found in tools/cli/dev-bundle.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

      Avoid too many return statements within this function.
      Open

        return new Promise(function (resolve, reject) {
          db.get(
            "SELECT content FROM releaseVersions WHERE track=? AND version=?",
            [track, version],
            function (error, data) {
      Severity: Major
      Found in tools/cli/dev-bundle.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return Promise.resolve(
            getDevBundleForRelease(release)
          ).then(function (devBundleDir) {
            if (devBundleDir) {
              links.makeLink(devBundleDir, devBundleLink);
        Severity: Major
        Found in tools/cli/dev-bundle.js - About 30 mins to fix

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

          function getDevBundleDir() {
            // Note that this code does not care if we are running meteor from a
            // checkout, because it's always better to respect the .meteor/release
            // file of the current app, if possible.
          
          
          Severity: Minor
          Found in tools/cli/dev-bundle.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