AllMangasReader-dev/AMR

View on GitHub

Showing 292 of 636 total issues

Avoid too many return statements within this function.
Open

        return -1;
Severity: Major
Found in js/popup.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return 1;
Severity: Major
Found in js/popup.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return -1;
Severity: Major
Found in js/popup.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return -1;
Severity: Major
Found in js/popup.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

                    return -1;
Severity: Major
Found in js/popupSearch.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return -1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return -1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return -1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return compareTo(a.chapterUrl, b.chapterUrl);
Severity: Major
Found in js/bookmarks.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return 3
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      if (a.shortName >  b.shortName) return 1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return compareTo(a.name, b.name);
Severity: Major
Found in js/bookmarks.js - About 30 mins to fix

Function isMirrorEnabled has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function isMirrorEnabled(mirrorName) {
  if (states != undefined) {
    for (var i = 0; i < states.length; i++) {
      if (states[i].mirror == mirrorName) {
        return states[i].state;
Severity: Minor
Found in js/backsite.js - About 25 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

Function hasDesactivatedOnce has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function hasDesactivatedOnce() {
    var states = localStorage["mirrorStates"];
    var lstTmp = JSON.parse(states);
    var nbActi = 0;
    if (lstTmp.length > 0) {
Severity: Minor
Found in js/background.js - About 25 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

Function initManifestVars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function initManifestVars() {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", chrome.extension.getURL('manifest.json'), false);
    xhr.onreadystatechange = function () {
        if (this.readyState == 4) {
Severity: Minor
Found in js/background.js - About 25 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

Function activatedMirrors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function activatedMirrors() {
    var list = new Array();
    var states = localStorage["mirrorStates"];
    var lstTmp = JSON.parse(states);
    if (lstTmp.length > 0) {
Severity: Minor
Found in js/background.js - About 25 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

Function grayscale has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function grayscale(cnv, w, h) {
    var imageData = cnv.getImageData(0, 0, w, h);
    for (var j = 0; j < imageData.height; j++) {
        for (var i = 0; i < imageData.width; i++) {
            var index = (i * 4) * imageData.width + (j * 4);
Severity: Minor
Found in js/background.js - About 25 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

Function isNew has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function isNew(mg) {
  "use strict";
  var ret = false;
  if (mg.read === 0) {
    if (mg.listChaps.length > 0) {
Severity: Minor
Found in js/popup.js - About 25 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

Function createMangaEntry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function createMangaEntry(mangas, where) {
  "use strict";
  if (parameters.popupMode === 1) {
    try {
      createMangaEntryBlock(mangas, where);
Severity: Minor
Found in js/popup.js - About 25 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

Function hasNew has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function hasNew() {
    for (var i = 0; i < mangaList.length; i++) {
        if (mangaList[i].listChaps.length > 0) {
            var lastName = mangaList[i].listChaps[0][1];
            if (lastName != mangaList[i].lastChapterReadURL && mangaList[i].read == 0) {
Severity: Minor
Found in js/background.js - About 25 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

Severity
Category
Status
Source
Language