ltgcgo/octavia

View on GitHub
src/cambiare_demo/index.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 7 of 7 total issues

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

    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

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

      let getBlobFrom = async function (filename) {
      let i = 0;
      while (i < srcPaths.length) {
      let e = srcPaths[i];
      let response = await fetch(`${e}${filename}`);
      Severity: Major
      Found in src/cambiare_demo/index.js and 2 other locations - About 4 hrs to fix
      oldsrc/cambiare_wa/index.js on lines 44..55
      src/demoTui/index.js on lines 47..58

      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 2 locations. Consider refactoring.
      Open

      getBridge().addEventListener("message", function (ev) {
      if (useMidiBus) {
      visualizer.sendCmd(ev.data);
      };
      //console.debug(ev.data);
      Severity: Minor
      Found in src/cambiare_demo/index.js and 1 other location - About 35 mins to fix
      src/demoTui/index.js on lines 238..243

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

      self.gGsLvl = async function (level) {
      visualizer.device.setGsTargets(false, level);
      Alpine.store("gsLvl", level);
      };
      Severity: Minor
      Found in src/cambiare_demo/index.js and 1 other location - About 30 mins to fix
      src/cambiare_demo/index.js on lines 168..171

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

      self.gScLvl = async function (level) {
      visualizer.device.setGsTargets(true, level);
      Alpine.store("scLvl", level);
      };
      Severity: Minor
      Found in src/cambiare_demo/index.js and 1 other location - About 30 mins to fix
      src/cambiare_demo/index.js on lines 164..167

      There are no issues that match your filters.

      Category
      Status