AllMangasReader-dev/AMR

View on GitHub

Showing 292 of 636 total issues

Function isMangaDisplayable has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function isMangaDisplayable(mg) {
  "use strict";
  var isInclude = false;
  var isExclude = false;
  var isNew = $(mg).hasClass("new");
Severity: Major
Found in js/popup.js - About 3 hrs to fix

Function importMangas has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

function importMangas(mangas, merge) {
    var textOut = "";
    if (!merge) {
        textOut += translate("background_impexp_del") + '\n';
        var deleteAr = [];
Severity: Minor
Found in js/background.js - About 2 hrs 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 consult has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.consult = function (obj, fromSite) {
    if (fromSite === undefined) {
      fromSite = false;
    }
    var posOld = -1,
Severity: Major
Found in js/MangaElt.js - About 2 hrs to fix

Function displayList has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function displayList(lst, updtSrv, where, noinfo) {
  if (where == undefined) {
    where = $("#mangalist");
  }
  if (noinfo == undefined) {
Severity: Major
Found in js/listmanager.js - About 2 hrs to fix

Function desactivateMirror has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function desactivateMirror(mirrorName) {
    var nb = 0;
    for (var i = 0; i < mangaList.length; i++) {
        if (mangaList[i].mirror == mirrorName) {
            nb++;
Severity: Minor
Found in js/background.js - About 2 hrs 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 testListMgs has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function testListMgs() {
  addResult("listmgs", "L", "Test if list of mangas can be loaded for this mirror.", $("<span>Loading...</span>"), "");
  getMangaMirror($("#mirrorList").val()).getMangaList($("#searchBoxInput").val(), function(mirName, lst) {
    var res = $("<div></div>");
    var isOk = true;
Severity: Major
Found in js/lab.js - About 2 hrs to fix

Function testInfos has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function testInfos(div, callback) {
  addResult("testinfos", "L", "Test if the manga informations can be retrieved from loaded page.", $("<span>Loading...</span>"), "");
  getMangaMirror($("#mirrorList").val()).getInformationsFromCurrentPage($(div), $("#lstChaps").val(), function(res) {
    var result = $("<div></div>");
    var isOk = true;
Severity: Major
Found in js/lab.js - About 2 hrs to fix

Function restore_options has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function restore_options() {
  "use strict";
  var response = chrome.extension.getBackgroundPage().getParameters(),
    colPicks;

Severity: Major
Found in js/options.js - About 2 hrs to fix

Function loadMangas has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function loadMangas() {
  "use strict";
  var main = $("#main"),
    mangasGrps = [],
    ancShName,
Severity: Minor
Found in js/popup.js - About 2 hrs 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 removeCategory has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function removeCategory(request, callback) {
    if (mangaList.length > 0) {
        for (var i = 0; i < mangaList.length; i++) {
            if (mangaList[i].cats.length > 0) {
                var toRem = [];
Severity: Minor
Found in js/background.js - About 2 hrs 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 importBookmarks has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function importBookmarks(bms, merge) {
    var textOut = "";
    if (!merge) {
        textOut += translate("background_impexp_del_bm") + '\n';
        var deleteAr = [];
Severity: Minor
Found in js/background.js - About 2 hrs 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 renderManga has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function renderManga(lstBms) {
    "use strict";
    var divChaps,
        divScans,
        parity = 0,
Severity: Minor
Found in js/bookmarks.js - About 2 hrs 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 testChapters has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function testChapters() {
  resetAfter("listmgs");
  addResult("listchaps", "L", "Test if list of chapters can be loaded for the selected manga.", $("<span>Loading...</span>"), "");

  getMangaMirror($("#mirrorList").val()).getListChaps($("#lstMangas").val(), $("#lstMangas option:selected").text(), null, function(lst, obj) {
Severity: Major
Found in js/lab.js - About 2 hrs to fix

Function onErrorImage has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function onErrorImage() {
  $(this).css("margin-bottom", "50px");
  $(this).css("margin-right", "10px");
  if (this.naturalWidth === 0) {
    //Here, number of tries before considering image can not be loaded
Severity: Major
Found in js/back.js - About 2 hrs to fix

Function prettyDate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function prettyDate(time) {
  "use strict";
  var diff = ((new Date().getTime() - time) / 1000);
  var day_diff = Math.floor(diff / 86400);
  if (isNaN(day_diff) || day_diff < 0) {
Severity: Minor
Found in js/popup.js - About 2 hrs 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 getBookmark has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function getBookmark(obj) {
    if (bookmarks.length > 0) {
        for (var j = 0; j < bookmarks.length; j++) {
            if (obj.mirror == bookmarks[j].mirror && obj.url == bookmarks[j].url && obj.chapUrl == bookmarks[j].chapUrl && obj.type == bookmarks[j].type) {
                if (obj.type == "chapter") {
Severity: Minor
Found in js/background.js - About 2 hrs 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 waitForEndLoad has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function waitForEndLoad() {
    if (nbToLoad != ancNbToLoad) {
        ancNbToLoad = nbToLoad;
        tempMirrorListAll.sort(function (a, b) {
            var aname = formatMgName(a.name);
Severity: Minor
Found in js/popupSearch.js - About 2 hrs 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 loadMangas has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loadMangas() {
  "use strict";
  var main = $("#main"),
    mangasGrps = [],
    ancShName,
Severity: Major
Found in js/popup.js - About 2 hrs to fix

Function traverse has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.traverse = function (_34) {
        var _35 = this,
            _36 = [],
            _37, _38, _39 = this.folder,
            _3a;
Severity: Major
Found in js/BSync.js - About 2 hrs to fix

Function createScan has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createScan(obj, where) {
    "use strict";
    var divImg = $("<div class='scanDiv'></div>");
    divImg.data("mirror", obj.mirror);
    divImg.data("url", obj.url);
Severity: Major
Found in js/bookmarks.js - About 2 hrs to fix
Severity
Category
Status
Source
Language