Showing 42 of 70 total issues
Function effects
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
function effects () {
var baseSample = bap.sample({
src: 'sounds/plong1.wav',
duration: 96,
Function boombap
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
function boombap () {
var drumKit = bap.kit();
var drumCompressor = bap.compressor({
threshold: -12,
gain: 110
Function sequences
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sequences () {
var lowPianoKit = bap.sample({
src: 'sounds/own_barricade_end.wav',
attack: 0.01,
Function slices
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function slices () {
var sampleKit = bap.kit();
var base = bap.sample({
src: 'sounds/slices.wav',
attack: 0.01,
Function _getCollectionEventBubblingHandler
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_getCollectionEventBubblingHandler: function (propertyName) {
return function (eventName, model, newValue, collection) {
var validNames = ['change', 'add', 'remove'];
if (~validNames.indexOf(eventName)) {
this.trigger('change:' + propertyName, model, newValue);
- 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 sequences
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sequences () {
var lowPianoKit = bap.sample({
src: 'sounds/own_barricade_end.wav',
attack: 0.01,
Function start
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function (time, note, channel, pattern, kit, slot) {
if (this.mute) { return; }
if (typeof time !== 'number') {
pattern = channel;
Function makeBuffer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
BufferHelper.makeBuffer = memoize(function (params, originalBuffer, context) {
var start = new Date();
var sampleRate = originalBuffer.sampleRate;
var numberOfChannels = BufferHelper.getChannelCount(params, originalBuffer);
- 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 _loadSample
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_loadSample: function (countLoading) {
var buffer = buffers[this.src];
this.context.resume();
if (!buffer) {
this.loaded = false;
- 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 start
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
start: function (time, note, channel, pattern, kit, slot) {
if (this.mute) { return; }
if (typeof time !== 'number') {
pattern = channel;
- 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 patterns
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
patterns: function (bar, outerOffset) {
if (typeof bar !== 'number') throw new Error('Invalid argument: bar is not a number');
if (bar < 1 || bar > this.bars) throw new Error('Invalid argument: bar is not within sequence length');
var patterns = {};
var sequences = this.sequences.slice();
Function makeBuffer
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
BufferHelper.makeBuffer = memoize(function (params, originalBuffer, context) {
var start = new Date();
var sampleRate = originalBuffer.sampleRate;
var numberOfChannels = BufferHelper.getChannelCount(params, originalBuffer);
Function _loadSample
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadSample: function (countLoading) {
var buffer = buffers[this.src];
this.context.resume();
if (!buffer) {
this.loaded = false;
Function mergeSources
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Params.mergeSources = memoize(function (params, sources) {
var multipliers = ['volume'];
var adders = ['pitch', 'pan'];
var keys = Object.keys(Params.prototype._definition);
Function instanceOf
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function instanceOf (type, Constructor) {
return {
set: function (newVal) {
if (newVal instanceof Constructor) {
- 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 instanceOfType
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function instanceOfType (type, types) {
return {
set: function (newVal) {
if (~types.indexOf(newVal.type)) {
- 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 overloadedAccessor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function overloadedAccessor (name, Ctor) {
var mixin = {};
mixin[name] = function (id, model) {
- 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 instanceOf
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function instanceOf (type, Constructor) {
return {
set: function (newVal) {
if (newVal instanceof Constructor) {
Function instanceOfType
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function instanceOfType (type, types) {
return {
set: function (newVal) {
if (~types.indexOf(newVal.type)) {
Function _triggerPlaybackStateEvent
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
_triggerPlaybackStateEvent: function(event, time, params, note, channel, pattern, kit, slot) {