ltgcgo/octavia

View on GitHub
src/compat/inject.js

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

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

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