ltgcgo/octavia

View on GitHub

Showing 47 of 48 total issues

Function loadResource has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

let loadResource = async () => {
if (resourceBlob) {
resourceViewer = new [MxBmDef, MxBm256, MxFont40, MxFont176][loadType.data]();
await resourceViewer.load(resourceBlob);
while (rsrcID.options.length > 0) {
Severity: Minor
Found in src/tsvView/index.js - About 1 hr to fix

    Function gOpenSmf has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    self.gOpenSmf = async function () {
    useMidiBus = false;
    let file = await fileOpen(propsMid);
    let fileSplit = file.name.lastIndexOf("."), ext = "";
    if (fileSplit > -1) {
    Severity: Minor
    Found in src/cambiare_demo/index.js - About 1 hr to fix

      Function renderImage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      let renderImage = function () {
      if (resourceViewer && rsrcID.options.length > 0) {
      switch (rType.data) {
      case 0: {
      // Single render
      Severity: Minor
      Found in src/tsvView/index.js - About 1 hr to fix

      Function fileReadAs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      let fileReadAs = function (blob, target) {
      let reader = new FileReader();
      return new Promise((success, failure) => {
      reader.addEventListener("abort", () => {
      failure(new Error("Blob read aborted"));
      Severity: Minor
      Found in src/compat/inject.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

        if (document.fullscreen || document.mozFullscreen || document.webkitFullscreen) {
        (document.exitFullscreen || document.mozExitFullscreen || document.webkitExitFullscreen).apply(document);
        } else {
        let cc = $e(".cambiare");
        (cc.requestFullscreen || cc.mozRequestFullscreen || cc.webkitRequestFullscreen).apply(cc);
        Severity: Major
        Found in src/cambiare_demo/index.js - About 1 hr to fix

          Function readUintBE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          const readUintBE = (buffer, byteLength) => {
          if (byteLength > 6) {
          throw(new RangeError(`Cannot read more than 48 bits`));
          };
          if (byteLength > buffer.length) {
          Severity: Minor
          Found in src/micc/utils.js - About 55 mins to fix

          Function renderSect has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          let renderSect = function (data, offX, offY, boundX, boundY, pixelSize, isTwoByOne) {
          Severity: Major
          Found in src/tsvView/index.js - About 50 mins to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export {
            toDecibel,
            gsChecksum,
            korgFilter,
            korgUnpack,
            Severity: Minor
            Found in src/state/utils.js and 1 other location - About 50 mins to fix
            src/disp/colour.js on lines 39..50

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export {
            bgOrange,
            bgGreen,
            bgWhite,
            bgRed,
            Severity: Minor
            Found in src/disp/colour.js and 1 other location - About 50 mins to fix
            src/state/utils.js on lines 123..134

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

            case "syx": {
            // Load SysEx blobs
            visualizer.sendCmd({type: 15, track: 0, data: new Uint8Array(await file.arrayBuffer())});
            break;
            };
            Severity: Major
            Found in src/cambiare_demo/index.js and 2 other locations - About 50 mins to fix
            oldsrc/cambiare_wa/index.js on lines 124..128
            src/demoTui/index.js on lines 140..144

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

            case "syx": {
            // Load SysEx blobs
            visualizer.sendCmd({type: 15, track: 0, data: new Uint8Array(await file.arrayBuffer())});
            break;
            };
            Severity: Major
            Found in src/demoTui/index.js and 2 other locations - About 50 mins to fix
            oldsrc/cambiare_wa/index.js on lines 124..128
            src/cambiare_demo/index.js on lines 203..207

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

            case "syx": {
            // Load SysEx blobs
            visualizer.sendCmd({type: 15, track: 0, data: new Uint8Array(await file.arrayBuffer())});
            break;
            };
            Severity: Major
            Found in oldsrc/cambiare_wa/index.js and 2 other locations - About 50 mins to fix
            src/cambiare_demo/index.js on lines 203..207
            src/demoTui/index.js on lines 140..144

            Function customInterpreter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            let customInterpreter = function (type, file, rawMtLen) {
            let u8Data = [];
            let metaLength = rawMtLen == false ? file.readIntVLV() : rawMtLen;
            if (type == 0 || type == 127) {
            //metaLength = 1;
            Severity: Minor
            Found in src/state/utils.js - About 45 mins to fix

            Function buildVLV has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            const buildVLV = (number) => {
            if (!Number.isInteger(number)) {
            throw(new TypeError(`Must be an integer`));
            };5
            if (number >= 268435456) {
            Severity: Minor
            Found in src/micc/utils.js - About 45 mins to fix

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            demoBlobs[e.title].wave = await (await getBlobFrom(`${e.title}.opus`)).blob();
            Severity: Major
            Found in oldsrc/cambiare_wa/index.js and 3 other locations - About 35 mins to fix
            oldsrc/cambiare_wa/index.js on lines 88..88
            src/demoTui/index.js on lines 93..93
            src/demoTui/index.js on lines 94..94

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            } else if (num < 161) {} else if (num < 0x5d0) {
            newChoice.appendChild(document.createTextNode(`: ${cpOverride[num] || String.fromCodePoint(num)}`));
            } else if (num < 0x5ef) {} else {
            Severity: Minor
            Found in src/tsvView/index.js and 1 other location - About 35 mins to fix
            src/tsvView/index.js on lines 119..121

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            } else if (num < 0x5ef) {} else {
            newChoice.appendChild(document.createTextNode(`: ${cpOverride[num] || String.fromCodePoint(num)}`));
            };
            Severity: Minor
            Found in src/tsvView/index.js and 1 other location - About 35 mins to fix
            src/tsvView/index.js on lines 117..119

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            demoBlobs[e.title].wave = await (await getBlobFrom(`${e.title}.opus`)).blob();
            Severity: Major
            Found in src/demoTui/index.js and 3 other locations - About 35 mins to fix
            oldsrc/cambiare_wa/index.js on lines 88..88
            oldsrc/cambiare_wa/index.js on lines 89..89
            src/demoTui/index.js on lines 93..93

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            demoBlobs[e.title].midi = await (await getBlobFrom(`${e.title}.mid`)).blob();
            Severity: Major
            Found in src/demoTui/index.js and 3 other locations - About 35 mins to fix
            oldsrc/cambiare_wa/index.js on lines 88..88
            oldsrc/cambiare_wa/index.js on lines 89..89
            src/demoTui/index.js on lines 94..94

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            demoBlobs[e.title].midi = await (await getBlobFrom(`${e.title}.mid`)).blob();
            Severity: Major
            Found in oldsrc/cambiare_wa/index.js and 3 other locations - About 35 mins to fix
            oldsrc/cambiare_wa/index.js on lines 89..89
            src/demoTui/index.js on lines 93..93
            src/demoTui/index.js on lines 94..94
            Severity
            Category
            Status
            Source
            Language