Function Bop
has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
exports.Bop = ( function () {
var isArray = Array.isArray
, isBuffer = Buffer.isBuffer
, min = Math.min
, max = Math.max
Function Bop
has 243 lines of code (exceeds 25 allowed). Consider refactoring.
exports.Bop = ( function () {
var isArray = Array.isArray
, isBuffer = Buffer.isBuffer
, min = Math.min
, max = Math.max
Similar blocks of code found in 2 locations. Consider refactoring.
, output = function ( n, e, s, t ) {
log( '- %s length is %s', n, t );
log( '- %s mem usage is %d KBytes', n, ( ( e.rss - s.rss ) / 1024 ).toFixed( 1 ) );
log( '- %s heap usage is %d KBytes', n, ( ( e.heapUsed - s.heapUsed ) / 1024 ).toFixed( 1 ) );
log( '- %s avg mem usage per element is %d bytes', n, ( ( e.rss - s.rss ) / t ).toFixed( 1 ) );
Similar blocks of code found in 2 locations. Consider refactoring.
, output = function ( n, e, s, t ) {
log( '- %s length is %s', n, t );
log( '- %s mem usage is %d KBytes', n, ( ( e.rss - s.rss ) / 1024 ).toFixed( 1 ) );
log( '- %s heap usage is %d KBytes', n, ( ( e.heapUsed - s.heapUsed ) / 1024 ).toFixed( 1 ) );
log( '- %s avg mem usage per element is %d bytes', n, ( ( e.rss - s.rss ) / t ).toFixed( 1 ) );
Similar blocks of code found in 2 locations. Consider refactoring.
var log = console.log
, Bop = require( '../' )
, hello = '------hello'
, line = new Buffer( hello + hello )
, bop = Bop( line )
Similar blocks of code found in 2 locations. Consider refactoring.
var log = console.log
, Bop = require( '../' )
, hello = '------hello'
, line = new Buffer( hello + hello )
, bop = Bop( line )
Function sdist
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
bproto.sdist = function ( data, start ) {
var me = this
, d = convert( data )
, p = me.p
, m = p.length
Function buildTestBuffer
has 30 lines of code (exceeds 25 allowed). Consider refactoring.
, buildTestBuffer = function ( p, MBsize, gapFactor ) {
var s = Date.now()
, mtime = 0
, len = p.length
, gap = Math.pow( len, ( gapFactor && gapFactor > 1 ) ? gapFactor : 3 )
Function dist
has 30 lines of code (exceeds 25 allowed). Consider refactoring.
bproto.dist = function ( data, start ) {
var me = this
, d = convert( data )
, p = me.p
, m = p.length
Function suffixes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
, suffixes : function ( p ) {
var m = p.length,
g = m - 1,
suff = ( m > 255 ) ? [] : new Buffer( m ),
f = 0,
Similar blocks of code found in 2 locations. Consider refactoring.
var m = p.length
, g = m - 1
, suff = ( m > 255 ) ? [] : new Buffer( m )
, f = 0
, i = 0
Similar blocks of code found in 2 locations. Consider refactoring.
var m = p.length,
g = m - 1,
suff = ( m > 255 ) ? [] : new Buffer( m ),
f = 0,
i = 0,
Function gsTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
, gsTable : function ( suff ) {
var m = suff.length,
gsuff = ( m > 255 ) ? [] : new Buffer( m ),
i = m - 2,
j = 0,
Similar blocks of code found in 2 locations. Consider refactoring.
var m = suff.length
, gsuff = ( m > 255 ) ? [] : new Buffer( m )
, i = m - 2
, j = 0
, offset = 0
Similar blocks of code found in 2 locations. Consider refactoring.
var m = suff.length,
gsuff = ( m > 255 ) ? [] : new Buffer( m ),
i = m - 2,
j = 0,
offset = 0;
Function buildTestBuffer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
, buildTestBuffer = function ( p, MBsize, gapFactor ) {
var s = Date.now()
, mtime = 0
, len = p.length
, gap = Math.pow( len, ( gapFactor && gapFactor > 1 ) ? gapFactor : 3 )
Similar blocks of code found in 2 locations. Consider refactoring.
var m = p.length
, bc = ( m > 255 ) ? [] : new Buffer( 256 )
, i = 0
, blen = bc.length || m
;
Similar blocks of code found in 2 locations. Consider refactoring.
var m = p.length,
bc = ( m > 255 ) ? [] : new Buffer( 256 ),
i = 0,
blen = bc.length || m;