rahulkapoor90/VITacademics-Enhancement-Suite

View on GitHub
Extension for Edge/backgroundScriptsAPIBridge.js

Summary

Maintainability
F
3 wks
Test Coverage

File backgroundScriptsAPIBridge.js has 846 lines of code (exceeds 250 allowed). Consider refactoring.
Open

if (!Range.prototype["intersectsNode"]) {
    Range.prototype["intersectsNode"] = function (node) {
        let range = document.createRange();
        range.selectNode(node);
        return 0 > this.compareBoundaryPoints(Range.END_TO_START, range)
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js - About 2 days to fix

Function constructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    constructor() {
        this.app = new EdgeChromeAppBridge();
        this.browserAction = typeof browser.browserAction !== "undefined" ? new EdgeChromeBrowserActionBridge() : undefined;
        this.contextMenus = typeof browser.contextMenus !== "undefined" ? new EdgeContextMenusBridge() : undefined;
        this.cookies = typeof browser.cookies !== "undefined" ? new EdgeChromeCookiesBridge() : undefined;
Severity: Minor
Found in Extension for Edge/backgroundScriptsAPIBridge.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function DoActionAndLog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    DoActionAndLog(action, name, deprecatedTo, bridgedTo) {
        var result;
        try {
            result = action();
            this.AddToCalledDictionary(this.SuccededCalls, name);
Severity: Minor
Found in Extension for Edge/backgroundScriptsAPIBridge.js - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

class EdgeBridgeDebugLog {
    constructor() {
        this.CatchOnException = true;
        this.VerboseLogging = true;
        this.FailedCalls = {};
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 4 days to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 46..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 726.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeRuntimeBridge {
    get id() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.id; }, "runtime.id"); }
    get lastError() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.lastError; }, "runtime.lastError"); }
    get onConnect() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onConnect; }, "runtime.onConnect"); }
    get onInstalled() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onInstalled; }, "runtime.onInstalled"); }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 3 days to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 212..260

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 599.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeChromeRuntimeBridge extends EdgeRuntimeBridge {
    get onConnectExternal() { bridgeLog.LogUnavailbleApi("runtime.onConnectExternal"); return bridgeHelper.fakeEvent; }
    get onRestartRequired() { bridgeLog.LogUnavailbleApi("runtime.onRestartRequired"); return bridgeHelper.fakeEvent; }
    get onStartup() { bridgeLog.LogUnavailbleApi("runtime.onStartup"); return bridgeHelper.fakeEvent; }
    get onSuspend() { bridgeLog.LogUnavailbleApi("runtime.onSuspend"); return bridgeHelper.fakeEvent; }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 2 days to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 261..305

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 467.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeChromeExtensionBridge extends EdgeExtensionBridge {
    get onConnect() { return bridgeLog.DoActionAndLog(() => { return EdgeRuntimeBridge.prototype.onConnect; }, "extension.onConnect", "runtime.onConnect", "runtime.onConnect"); }
    get onMessage() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onMessage; }, "extension.onMessage", "runtime.onMessage", "runtime.onMessage"); }
    get onRequest() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onMessage; }, "extension.onRequest", "runtime.onMessage", "runtime.onMessage"); }
    get onRequestExternal() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onMessageExternal; }, "extension.onRequestExternal", "runtime.onMessageExternal", "runtime.onMessageExternal"); }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 2 days to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 155..186

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 437.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeI18nBridge {
    getAcceptLanguages(callback) {
        return bridgeLog.DoActionAndLog(() => {
            return myBrowser.i18n.getAcceptLanguages(callback);
        }, "i18n.getAcceptLanguages");
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 1 day to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 187..211

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 203.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeBridgeHelper {
    constructor() {
        this.fakeEvent = new FakeEvent();
    }
    toAbsolutePath(relativePath) {
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 6 hrs to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 27..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 163.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeExtensionBridge {
    getBackgroundPage() {
        return bridgeLog.DoActionAndLog(() => {
            return myBrowser.extension.getBackgroundPage();
        }, "extension.getBackgroundPage");
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 4 hrs to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 138..154

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 127.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

if (!Range.prototype["intersectsNode"]) {
    Range.prototype["intersectsNode"] = function (node) {
        let range = document.createRange();
        range.selectNode(node);
        return 0 > this.compareBoundaryPoints(Range.END_TO_START, range)
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 3 hrs to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 1..8

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 104.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    sendMessage(tabId, message, responseCallback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof responseCallback !== "undefined" && typeof responseCallback !== "null") {
                myBrowser.tabs.sendMessage(tabId, message, responseCallback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 5 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 258..267
Extension for Edge/backgroundScriptsAPIBridge.js on lines 604..613
Extension for Edge/backgroundScriptsAPIBridge.js on lines 624..633
Extension for Edge/backgroundScriptsAPIBridge.js on lines 659..668
Extension for Edge/backgroundScriptsAPIBridge.js on lines 809..818

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 88.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    update(windowId, updateInfo, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.windows.update(windowId, updateInfo, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 5 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 258..267
Extension for Edge/backgroundScriptsAPIBridge.js on lines 604..613
Extension for Edge/backgroundScriptsAPIBridge.js on lines 624..633
Extension for Edge/backgroundScriptsAPIBridge.js on lines 649..658
Extension for Edge/backgroundScriptsAPIBridge.js on lines 659..668

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 88.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    update(tabId, updateProperties, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.tabs.update(tabId, updateProperties, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 5 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 258..267
Extension for Edge/backgroundScriptsAPIBridge.js on lines 604..613
Extension for Edge/backgroundScriptsAPIBridge.js on lines 624..633
Extension for Edge/backgroundScriptsAPIBridge.js on lines 649..658
Extension for Edge/backgroundScriptsAPIBridge.js on lines 809..818

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 88.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    insertCSS(tabId, details, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.tabs.insertCSS(tabId, details, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 5 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 258..267
Extension for Edge/backgroundScriptsAPIBridge.js on lines 604..613
Extension for Edge/backgroundScriptsAPIBridge.js on lines 649..658
Extension for Edge/backgroundScriptsAPIBridge.js on lines 659..668
Extension for Edge/backgroundScriptsAPIBridge.js on lines 809..818

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 88.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    executeScript(tabId, details, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.tabs.executeScript(tabId, details, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 5 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 258..267
Extension for Edge/backgroundScriptsAPIBridge.js on lines 624..633
Extension for Edge/backgroundScriptsAPIBridge.js on lines 649..658
Extension for Edge/backgroundScriptsAPIBridge.js on lines 659..668
Extension for Edge/backgroundScriptsAPIBridge.js on lines 809..818

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 88.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    update(id, updateProperties, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.contextMenus.update(id, updateProperties, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 5 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 604..613
Extension for Edge/backgroundScriptsAPIBridge.js on lines 624..633
Extension for Edge/backgroundScriptsAPIBridge.js on lines 649..658
Extension for Edge/backgroundScriptsAPIBridge.js on lines 659..668
Extension for Edge/backgroundScriptsAPIBridge.js on lines 809..818

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 88.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    remove(menuItemId, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.contextMenus.remove(menuItemId, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 228..237
Extension for Edge/backgroundScriptsAPIBridge.js on lines 280..289
Extension for Edge/backgroundScriptsAPIBridge.js on lines 290..299
Extension for Edge/backgroundScriptsAPIBridge.js on lines 589..598
Extension for Edge/backgroundScriptsAPIBridge.js on lines 639..648
Extension for Edge/backgroundScriptsAPIBridge.js on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    set(details, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.cookies.set(details, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 228..237
Extension for Edge/backgroundScriptsAPIBridge.js on lines 238..247
Extension for Edge/backgroundScriptsAPIBridge.js on lines 280..289
Extension for Edge/backgroundScriptsAPIBridge.js on lines 589..598
Extension for Edge/backgroundScriptsAPIBridge.js on lines 639..648
Extension for Edge/backgroundScriptsAPIBridge.js on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    remove(details, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.cookies.remove(details, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 228..237
Extension for Edge/backgroundScriptsAPIBridge.js on lines 238..247
Extension for Edge/backgroundScriptsAPIBridge.js on lines 290..299
Extension for Edge/backgroundScriptsAPIBridge.js on lines 589..598
Extension for Edge/backgroundScriptsAPIBridge.js on lines 639..648
Extension for Edge/backgroundScriptsAPIBridge.js on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    create(createData, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.windows.create(createData, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 228..237
Extension for Edge/backgroundScriptsAPIBridge.js on lines 238..247
Extension for Edge/backgroundScriptsAPIBridge.js on lines 280..289
Extension for Edge/backgroundScriptsAPIBridge.js on lines 290..299
Extension for Edge/backgroundScriptsAPIBridge.js on lines 589..598
Extension for Edge/backgroundScriptsAPIBridge.js on lines 639..648

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    create(createProperties, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.contextMenus.create(createProperties, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 238..247
Extension for Edge/backgroundScriptsAPIBridge.js on lines 280..289
Extension for Edge/backgroundScriptsAPIBridge.js on lines 290..299
Extension for Edge/backgroundScriptsAPIBridge.js on lines 589..598
Extension for Edge/backgroundScriptsAPIBridge.js on lines 639..648
Extension for Edge/backgroundScriptsAPIBridge.js on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    create(createProperties, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.tabs.create(createProperties, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 228..237
Extension for Edge/backgroundScriptsAPIBridge.js on lines 238..247
Extension for Edge/backgroundScriptsAPIBridge.js on lines 280..289
Extension for Edge/backgroundScriptsAPIBridge.js on lines 290..299
Extension for Edge/backgroundScriptsAPIBridge.js on lines 639..648
Extension for Edge/backgroundScriptsAPIBridge.js on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    remove(tabId, callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.tabs.remove(tabId, callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 6 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 228..237
Extension for Edge/backgroundScriptsAPIBridge.js on lines 238..247
Extension for Edge/backgroundScriptsAPIBridge.js on lines 280..289
Extension for Edge/backgroundScriptsAPIBridge.js on lines 290..299
Extension for Edge/backgroundScriptsAPIBridge.js on lines 589..598
Extension for Edge/backgroundScriptsAPIBridge.js on lines 779..788

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeChromeStorageBridge extends EdgeStorageBridge {
    get managed() { return bridgeLog.DoActionAndLog(() => { return myBrowser.storage.local; }, "storage.managed", undefined, "storage.local"); }
    get sync() { return bridgeLog.DoActionAndLog(() => { return myBrowser.storage.local; }, "storage.sync", undefined, "storage.local"); }
}
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 2 hrs to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 310..313

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    enable(tabId) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof tabId !== "undefined" && typeof tabId !== "null") {
                myBrowser.browserAction.enable(tabId);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 2 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 248..257
Extension for Edge/backgroundScriptsAPIBridge.js on lines 762..771

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 82.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    removeAll(callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.contextMenus.removeAll(callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 2 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 156..165
Extension for Edge/backgroundScriptsAPIBridge.js on lines 762..771

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 82.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    handlerBehaviorChanged(callback) {
        bridgeLog.DoActionAndLog(() => {
            if (typeof callback !== "undefined" && typeof callback !== "null") {
                myBrowser.webRequest.handlerBehaviorChanged(callback);
            }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 2 other locations - About 2 hrs to fix
Extension for Edge/backgroundScriptsAPIBridge.js on lines 156..165
Extension for Edge/backgroundScriptsAPIBridge.js on lines 248..257

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 82.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class EdgeStorageBridge {
    get local() { return bridgeLog.DoActionAndLog(() => { return myBrowser.storage.local; }, "storage.local"); }
    get onChanged() { return bridgeLog.DoActionAndLog(() => { return myBrowser.storage.onChanged; }, "storage.onChanged"); }
}
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 2 hrs to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 306..309

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class FakeEvent {
    addListener(callback) { }
    addRules(rules, callback) { }
    getRules(ruleIdentifiers, callback) { }
    hasListener(callback) { return false; }
Severity: Major
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 2 hrs to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 18..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 77.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

var getExtensionProtocol = function () {
    if (typeof browser == "undefined") {
        if (typeof chrome !== "undefined")
            return "chrome-extension://";
    }
Severity: Minor
Found in Extension for Edge/backgroundScriptsAPIBridge.js and 1 other location - About 30 mins to fix
Extension for Edge/contentScriptsAPIBridge.js on lines 9..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status