Showing 10 of 10 total issues
Function init
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
exports.init = function(grunt) {
/**
* Add the json arg for commands that accept it
*
- 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"
Further reading
Function exports
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
Function exports
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
// Flow control library
var Flow = require('./lib/run').init(grunt);
var FlowArgs = require('./lib/args').init(grunt);
Function init
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.init = function(grunt) {
/**
* Add the json arg for commands that accept it
*
Function init
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.init = function(grunt) {
/**
* Run the flow command
*
Function run
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.run = function(args, opts, input, done) {
/**
* Some errors we just need to alert the user, and some we need to fail
*
Function which
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function which(cmd) {
if (absUnix(cmd)) { return cmd; }
var pathEnv = (process.env.PATH || '').split(COLON);
var pathExt = [''];
- 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"
Further reading
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(input, path) {
if (!input || (input && typeof input.passed === 'undefined')) {
return input;
}
Function init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.init = function(grunt) {
/**
* Run the flow command
*
- 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"
Further reading
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(input, path) {
if (!input || (input && typeof input.passed === 'undefined')) {
return input;
}
- 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"