ltgcgo/octavia

View on GitHub
src/tsvView/index.js

Summary

Maintainability
C
7 hrs
Test Coverage

Showing 6 of 6 total issues

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

      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

      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

      There are no issues that match your filters.

      Category
      Status