Showing 11 of 13 total issues
Function Libra
has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.Libra = ( function () {
var Bolgia = require( 'bolgia' )
, doString = Bolgia.doString
, clone = Bolgia.clone
, improve = Bolgia.improve
- 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 Libra
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.Libra = ( function () {
var Bolgia = require( 'bolgia' )
, doString = Bolgia.doString
, clone = Bolgia.clone
, improve = Bolgia.improve
Function pop
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lproto.pop = function () {
var me = this
, status = me.status
, tstamp = me.options.timestamps
, m = status.monitoring
Function Libra
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, Libra = function ( opt ) {
var me = this
, is = me instanceof Libra
;
if ( ! is ) return new Libra( opt );
Avoid too many return
statements within this function. Open
Open
return cqueue.shift();
Avoid too many return
statements within this function. Open
Open
return cqueue.shift();
Avoid too many return
statements within this function. Open
Open
return cqueue.shift();
Avoid too many return
statements within this function. Open
Open
if ( ! ocmd.isSubscription ) return sendError( ocmd, cname + ' command is not allowed in PubSub mode.' );
Avoid too many return
statements within this function. Open
Open
return cqueue.shift();
Avoid too many return
statements within this function. Open
Open
return cqueue.qtail.push( ocmd ) + cqueue.qhead.length - cqueue.hpos;
Avoid too many return
statements within this function. Open
Open
if ( curr.expectedMessages ) return --curr.expectedMessages ? curr : cqueue.shift();