nfroidure/midifile

View on GitHub

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;
          }
Severity: Major
Found in src/MIDIFile.js - About 45 mins to fix

    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 +
            '),' +
    Severity: Minor
    Found in src/MIDIFileHeader.js and 1 other location - About 35 mins to fix
    src/MIDIFileHeader.js on lines 62..69

    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

    Further Reading

    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 +
            '),' +
    Severity: Minor
    Found in src/MIDIFileHeader.js and 1 other location - About 35 mins to fix
    src/MIDIFileHeader.js on lines 74..81

    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

    Further Reading

    Replace 'use·strict' with "use·strict"
    Open

    'use strict';
    Severity: Minor
    Found in karma.conf.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace '·size·of·25bytes.' with "·size·of·25bytes."
    Open

              ' size of 25bytes.'
    Severity: Minor
    Found in src/MIDIFile.js by eslint

    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++) {
    Severity: Minor
    Found in src/MIDIFile.js by eslint

    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 + ')');
    Severity: Minor
    Found in src/MIDIFile.js by eslint

    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 + ').');
    Severity: Minor
    Found in src/MIDIFileHeader.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Delete ··
    Open

              this.datas.getUint8(MIDIFileTrack.HDR_LENGTH + (trackLength - 3)) &&
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    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' +
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace ').' with ")."
    Open

              ').'
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace './MIDIFileHeader' with "./MIDIFileHeader"
    Open

    var MIDIFileHeader = require('./MIDIFileHeader');
    Severity: Minor
    Found in src/MIDIFile.js by eslint

    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++) {
    Severity: Minor
    Found in src/MIDIFile.js by eslint

    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.');
    Severity: Minor
    Found in src/MIDIFile.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace 'T' with "T"
    Open

            'T' === String.fromCharCode(this.datas.getUint8(1)) &&
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace ')·:' with ")·:"
    Open

              ') :' +
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace 'Invalid·MIDIFileTrack·(0x' with "Invalid·MIDIFileTrack·(0x"
    Open

            'Invalid MIDIFileTrack (0x' +
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Replace ')·:' with ")·:"
    Open

              ') :' +
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Delete ⏎········
    Open

          !(
    Severity: Minor
    Found in src/MIDIFileTrack.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Delete ,
    Open

          debug: false,
    Severity: Minor
    Found in karma.conf.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Severity
    Category
    Status
    Source
    Language