Showing 6 of 13 total issues
Function load
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load(src) {
const audioContext = this.audioContext;
const _load = this._load.bind(this);
const _loadFont = this._loadFont.bind(this);
const _loadBeatTrack = this._loadBeatTrack.bind(this);
Function onPlaySet
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onPlaySet(key) {
const startingValues = this.startingValues;
const exponentialValues = this.exponentialRampToValuesAtTime;
const linearValues = this.linearRampToValuesAtTime;
const valuesAtTime = this.setValuesAtTime;
Function _initConnections
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initConnections: on('init', function () {
const bufferSource = Connection.create({
name: 'audioSource',
createdOnPlay: true,
source: 'audioContext',
Function _initConnections
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initConnections: on('init', function () {
const bufferSource = this._createBufferSource();
const gain = this._createGainNode();
const panner = this._createPannerNode();
const destination = this._createDestinationNode();
Function seek
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
seek(amount) {
const duration = this.get('duration.raw');
const moveToOffset = (offset) => {
const isPlaying = this.isPlaying;
- 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 _createNode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
_createNode(connection) {
const { path, name, createdOnPlay, source, createCommand, node } =
connection;
if (node && !createdOnPlay) {
- 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"