deps/npm/lib/build.js
Function linkMans
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function linkBins
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function linkBins (pkg, folder, parent, gtop, cb) {
if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") {
return cb()
}
var binRoot = gtop ? npm.globalBin
Function build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function build (args, global, didPre, didRB, cb) {
Function linkStuff
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function linkStuff (pkg, folder, global, didRB, cb) {
Function linkBins
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function linkBins (pkg, folder, parent, gtop, cb) {
Function linkMans
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function linkMans (pkg, folder, parent, gtop, cb) {
Function rebuildBundles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function rebuildBundles (pkg, folder, parent, gtop, cb) {
Function linkStuff
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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,
- Read upRead up
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"