Showing 21 of 31 total issues
Function install
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
var install = function (packages, callback) {
var i = 0;
var i1 = -1;
var i2 = -1;
var i3 = -1;
- Create a ticketCreate a ticket
Function install
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var install = function (argv, callback) {
var i1 = -1;
var i2 = -1;
var i3 = -1;
var i4 = -1;
- Create a ticketCreate a ticket
Function uninstall
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var uninstall = function (packages, callback) {
var i = 0;
var i1 = -1;
var i2 = -1;
var wanted = [];
- Create a ticketCreate a ticket
Function uninstall
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var uninstall = function (argv, callback) {
var i1 = -1;
var i2 = -1;
var packages = argv.packages;
var long = [];
- Create a ticketCreate a ticket
Function argv
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var argv = function (argv) {
argv = yargs
.alias('V', 'version')
.alias('h', 'help')
- Create a ticketCreate a ticket
Function i
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
repoReq[i] = request(repoOpts, function (err, res, data) {
i1++;
if (err || res.statusCode !== 200) {
callback(new Error('Can\'t reach URL: %s', repoUrl[i1]), undefined);
return;
- Create a ticketCreate a ticket
Function alternatives
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var alternatives = function (pack, callback) {
var wanted = {
package: pack.split('-')[0],
version: pack.split('-')[1] || false,
- Create a ticketCreate a ticket
Function extract
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var extract = function (match, k, callback) {
var long = match.package + '-' + match.version + '-' + match.platform;
var share = untilde(rc.dir.share + '/' + match.package);
- Create a ticketCreate a ticket
Function match
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var match = function match(wanted, data) {
function calcVersion(item) {
var calc = '';
/*jshint unused:false */
- Create a ticketCreate a ticket
Function argv
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var argv = function (argv) {
argv = yargs
.alias('V', 'version')
.alias('h', 'help')
- Read upRead up
- Create a ticketCreate a ticket
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 alternatives
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var alternatives = function (argv, callback) {
var share = util.untilde(rc.dir.share + '/' + argv.package);
// Get local packages
- Create a ticketCreate a ticket
Function register
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var register = function (match, l, callback) {
if (match.bin === undefined) {
callback(null);
return;
- Create a ticketCreate a ticket
Function cli
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var cli = function (argv) {
argv = cliUtil.argv(argv);
// Mute stdout for quiet execution
if (argv.quiet) {
- Create a ticketCreate a ticket
Function remove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var remove = function (match, i, callback) {
emitter.emit('unreg-start-' + i);
var long = match.package + '-' + match.version + '-' + match.platform;
var binPath;
- Create a ticketCreate a ticket
Function remove
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var remove = function (match, i, callback) {
emitter.emit('unreg-start-' + i);
var long = match.package + '-' + match.version + '-' + match.platform;
var binPath;
- Read upRead up
- Create a ticketCreate a ticket
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 match
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var match = function match(wanted, data) {
function calcVersion(item) {
var calc = '';
/*jshint unused:false */
- Read upRead up
- Create a ticketCreate a ticket
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 install
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var install = function (packages, callback) {
var i = 0;
var i1 = -1;
var i2 = -1;
var i3 = -1;
- Read upRead up
- Create a ticketCreate a ticket
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 uninstall
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var uninstall = function (packages, callback) {
var i = 0;
var i1 = -1;
var i2 = -1;
var wanted = [];
- Read upRead up
- Create a ticketCreate a ticket
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 argv;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return 'alternatives';
- Create a ticketCreate a ticket