ltgcgo/octavia

View on GitHub

Showing 13 of 44 total issues

Function rawToPool has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

let rawToPool = function (midiJson) {
//console.debug(midiJson);
let list = new TimedEvents();
let upThis = this;
let timeDiv = midiJson.timeDivision,
Severity: Major
Found in src/basic/transform.js - About 3 hrs to fix

    Function renderSect has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    let renderSect = function (data, offX, offY, boundX, boundY, pixelSize, isTwoByOne) {
    if (resourceViewer && data) {
    for (let i = 0; i < data.length; i ++) {
    let iX = i % data.width, iY = (i - iX) / data.width;
    if (iX < boundX && iY < boundY) {
    Severity: Minor
    Found in src/tsvView/index.js - About 2 hrs to fix

    Function sysexBitmap has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    let sysexBitmap = function (frameData, type = "xg", frameId = 0, noCopy) {
    if (!frameData?.length) {
    throw Error(`Blank frame data`);
    };
    // 0 for XG, 1 for GS, 2 for NS5R
    Severity: Major
    Found in src/state/emitGlobal.js - About 2 hrs to fix

      Function sysexBitmap has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      let sysexBitmap = function (frameData, type = "xg", frameId = 0, noCopy) {
      if (!frameData?.length) {
      throw Error(`Blank frame data`);
      };
      // 0 for XG, 1 for GS, 2 for NS5R
      Severity: Minor
      Found in src/state/emitGlobal.js - About 1 hr to fix

      Function arrowGen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      let arrowGen = function (charArr, value, border, unit) {
      let boundLow = border - (unit >> 1), boundHi = border + (unit >> 1);
      if (value > border) {
      for (let c = 0; value > border; c ++) {
      charArr[c] = (value < boundHi) ? "=" : ">";
      Severity: Minor
      Found in src/disp/texted.js - About 1 hr to fix

      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 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

                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 replaceAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                String.prototype.replaceAll = String.prototype.replaceAll || function (source, target) {
                let antiLoop = 0, maxSafe = 16;
                let indexFinder = this, indexes = [];
                while (antiLoop < maxSafe && indexFinder.lastIndexOf(source) > -1) {
                let index = indexFinder.lastIndexOf(source);
                Severity: Minor
                Found in src/compat/inject.js - About 25 mins to fix
                Severity
                Category
                Status
                Source
                Language