ltgcgo/octavia

View on GitHub
src/demoTui/index.js

Summary

Maintainability
D
2 days
Test Coverage

Showing 9 of 9 total issues

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

demoPool.data.forEach((e, i) => {
if (i) {
let space = document.createElement("span");
space.innerHTML = " ";
stList.appendChild(space);
Severity: Major
Found in src/demoTui/index.js and 1 other location - About 6 hrs to fix
oldsrc/cambiare_wa/index.js on lines 59..73

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/demoTui/index.js and 2 other locations - About 4 hrs to fix
oldsrc/cambiare_wa/index.js on lines 44..55
src/cambiare_demo/index.js on lines 88..99

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

$e("#openAudio").addEventListener("click", async function () {
useMidiBus = false;
midwIndicator.classList.off("active");
if (audioBlob) {
URL.revokeObjectURL(audioBlob);
Severity: Major
Found in src/demoTui/index.js and 1 other location - About 2 hrs to fix
oldsrc/cambiare_wa/index.js on lines 143..151

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

stSwitch.to = function (i) {
stSwitch.forEach(function (e) {
e.classList.off("active");
});
if (i > -1) {
Severity: Major
Found in src/demoTui/index.js and 3 other locations - About 2 hrs to fix
oldsrc/cambiare_wa/index.js on lines 24..31
oldsrc/cambiare_wa/index.js on lines 74..81
src/demoTui/index.js on lines 77..84

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

stDemo.to = function (i) {
stDemo.forEach(function (e) {
e.classList.off("active");
});
if (i > -1) {
Severity: Major
Found in src/demoTui/index.js and 3 other locations - About 2 hrs to fix
oldsrc/cambiare_wa/index.js on lines 24..31
oldsrc/cambiare_wa/index.js on lines 74..81
src/demoTui/index.js on lines 22..29

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

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

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/demoTui/index.js and 1 other location - About 35 mins to fix
src/cambiare_demo/index.js on lines 367..372
Category
Status