deps/npm/lib/build.js

Summary

Maintainability
B
5 hrs
Test Coverage

Function linkMans has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function linkMans (pkg, folder, parent, gtop, cb) {
  if (!pkg.man || !gtop || process.platform === "win32") return cb()

  var manRoot = path.resolve(npm.config.get("prefix"), "share", "man")
  log.verbose("linkMans", "man files are", pkg.man, "in", manRoot)
Severity: Minor
Found in deps/npm/lib/build.js - About 1 hr to fix

    Function linkBins has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function linkBins (pkg, folder, parent, gtop, cb) {
      if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") {
        return cb()
      }
      var binRoot = gtop ? npm.globalBin
    Severity: Minor
    Found in deps/npm/lib/build.js - About 1 hr to fix

      Function build has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function build (args, global, didPre, didRB, cb) {
      Severity: Minor
      Found in deps/npm/lib/build.js - About 35 mins to fix

        Function linkStuff has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function linkStuff (pkg, folder, global, didRB, cb) {
        Severity: Minor
        Found in deps/npm/lib/build.js - About 35 mins to fix

          Function linkBins has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function linkBins (pkg, folder, parent, gtop, cb) {
          Severity: Minor
          Found in deps/npm/lib/build.js - About 35 mins to fix

            Function linkMans has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function linkMans (pkg, folder, parent, gtop, cb) {
            Severity: Minor
            Found in deps/npm/lib/build.js - About 35 mins to fix

              Function rebuildBundles has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function rebuildBundles (pkg, folder, parent, gtop, cb) {
              Severity: Minor
              Found in deps/npm/lib/build.js - About 35 mins to fix

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

                function linkStuff (pkg, folder, global, didRB, cb) {
                  // allow to opt out of linking binaries.
                  if (npm.config.get("bin-links") === false) return cb()
                
                  // if it's global, and folder is in {prefix}/node_modules,
                Severity: Minor
                Found in deps/npm/lib/build.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