Showing 42 of 70 total issues
Function notes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
notes: function (bar, beat, tick) {
if (!bar) return this.expandedNotes.models.slice();
var cache = this._cache;
var beats = cache[bar];
if (!beat) return (beats && beats['*'] || []).slice();
- 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 copyChannelData
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
BufferHelper.copyChannelData = function (originalBuffer, outputBuffer, sourceChannel, targetChannel, startIndex, targetStartIndex, copyLength) {
Function uncachedPossibleSteps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Clock.uncachedPossibleSteps = function (bar, beat, bars, beats) {
var steps = new Array(192);
var index = 0;
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
start: function (time, note, channel, pattern, kit, slot) {
Function start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
start: function (sequence) {
if (!inited) {
init(this.context);
}
- 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 stop
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
stop: function (time, note, channel, pattern, kit, slot) {
Function constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor: function () {
var args = Array.prototype.slice.call(arguments);
var types = ['sequence', 'pattern'];
var sequences = [];
var cont = true;
- 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 _updateTempo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_updateTempo: function (position) {
if (!this.sequence) {
this.tempo = 120;
}
else if (position && this.sequence.tempoAt) {
- 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 _params
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_params: function (note, channel, pattern, kit, slot) {
Function _paramsSources
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_paramsSources: function (note, channel, pattern, kit, slot) {
Function diffChannelsData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
BufferHelper.diffChannelsData = function (originalBuffer, outputBuffer, startIndex, targetStartIndex, copyLength) {
Function start
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
start: function (time, note, channel, pattern, kit) {
Function stop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
stop: function (time, note, channel, pattern, kit) {
Function mergeChannelsData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
BufferHelper.mergeChannelsData = function (originalBuffer, outputBuffer, startIndex, targetStartIndex, copyLength) {
Function set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
set: function (newVal) {
if (typeof newVal === 'boolean' || ~types.indexOf(newVal)) {
return { val: newVal, type: 'bypassType' };
}
else if (Array.isArray(newVal)) {
- 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 a Cognitive Complexity of 7 (exceeds 5 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();
- 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 calculateLength
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Params.calculateLength = function (params) {
var existingLength = params.length || 0;
var lengthFromDuration = params.duration && Params.lengthFromDuration(params, params.duration) || 0;
if (lengthFromDuration && lengthFromDuration < existingLength || !existingLength) {
params.hasLengthFromDuration = true;
- 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 _params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_params: function () {
var params = Layer.prototype._params.apply(this, arguments);
params.length = params.length || this.buffer && (this.buffer.duration - params.offset) || 0;
- 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 bitcrush
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
BufferHelper.bitcrush = function (buffer, channel, params) {
var data = buffer.getChannelData(channel);
var bits = params.bitcrush;
var normfreq = (params.bitcrushFrequency - 20) / 22030;
var mix = (params.bitcrushMix || 50) / 100;
- 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 slot
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
slot: function (id, slot) {
if (!id || typeof id !== 'string') {
throw new Error('Invalid slot identifier: ' + id);
}
else if (!slot) {
- 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"