Showing 109 of 109 total issues
Avoid deeply nested control flow statements. Open
if (i !== smallestDelta && trackParsers[i].curEvent) {
trackParsers[i].curEvent.delta -=
trackParsers[smallestDelta].curEvent.delta;
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (0 !== format && 1 !== format && 2 !== format) {
throw new Error(
'Invalid MIDI format given (' +
format +
'),' +
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (0 !== format && 1 !== format && 2 !== format) {
throw new Error(
'Invalid MIDI file : MIDI format (' +
format +
'),' +
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Replace 'use·strict'
with "use·strict"
Open
'use strict';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '·size·of·25bytes.'
with "·size·of·25bytes."
Open
' size of 25bytes.'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace i·=·0,·j·=·events.length
with (i·=·0),·(j·=·events.length)
Open
for (i = 0, j = events.length; i < j; i++) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Invalid·track·index·('·+·index·+·')'
with "Invalid·track·index·("·+·index·+·")"
Open
throw Error('Invalid track index (' + index + ')');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Invalid·SMPTE·frames·value·('·+·smpteFrames·+·').'
with "Invalid·SMPTE·frames·value·("·+·smpteFrames·+·")."
Open
throw new Error('Invalid SMPTE frames value (' + smpteFrames + ').');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
this.datas.getUint8(MIDIFileTrack.HDR_LENGTH + (trackLength - 3)) &&
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '·No·track·end·event·found·at·the·expected·index'
with "·No·track·end·event·found·at·the·expected·index"
Open
' No track end event found at the expected index' +
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ').'
with ")."
Open
').'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './MIDIFileHeader'
with "./MIDIFileHeader"
Open
var MIDIFileHeader = require('./MIDIFileHeader');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace i·=·0,·j·=·this.tracks.length
with (i·=·0),·(j·=·this.tracks.length)
Open
for (i = 0, j = this.tracks.length; i < j; i++) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'A·track·must·contain·at·least·one·event,·none·given.'
with "A·track·must·contain·at·least·one·event,·none·given."
Open
throw Error('A track must contain at least one event, none given.');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'T'
with "T"
Open
'T' === String.fromCharCode(this.datas.getUint8(1)) &&
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ')·:'
with ")·:"
Open
') :' +
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Invalid·MIDIFileTrack·(0x'
with "Invalid·MIDIFileTrack·(0x"
Open
'Invalid MIDIFileTrack (0x' +
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ')·:'
with ")·:"
Open
') :' +
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ⏎········
Open
!(
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ,
Open
debug: false,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/