Showing 6 of 6 total issues
Function factory
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function factory (self, method) {
method = method === 'series' ? 'mapSeries' : method
method = method === 'parallel' ? 'map' : method
return function _factory_ (fns, exts) {
- 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 factory
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function factory (self, method) {
method = method === 'series' ? 'mapSeries' : method
method = method === 'parallel' ? 'map' : method
return function _factory_ (fns, exts) {
- Create a ticketCreate a ticket
Function _factory_
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function _factory_ (fns, exts) {
if (kindOf(fns) === 'function') {
fns = [fns]
}
if (kindOf(fns) !== 'array' && kindOf(fns) !== 'object') {
- Create a ticketCreate a ticket
Function complete
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function complete () {
var argz = handleArguments(arguments)
var results = []
nowAndLater[method](fns, iterator, extensions, lastCallback(context, argz.callback))
- Create a ticketCreate a ticket
Function _defaultOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
Benz.prototype._defaultOptions = function _defaultOptions () {
if (!this.hasOption('context') || !isObject(this.option('context'))) {
this.option('context', null)
}
if (!this.hasOption('promise') || !this.isBoolean('promise')) {
- 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 _defaultOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Benz.prototype._defaultOptions = function _defaultOptions () {
if (!this.hasOption('context') || !isObject(this.option('context'))) {
this.option('context', null)
}
if (!this.hasOption('promise') || !this.isBoolean('promise')) {
- Create a ticketCreate a ticket