AllMangasReader-dev/AMR

View on GitHub

Showing 292 of 636 total issues

Function readManga has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function readManga(request, callback, doSave) {
    var mangaExist = isInMangaList(request.url);
    if (mangaExist == null) {
        var newManga = new MangaElt(request);
        var simMgs = getSimilarMangaTitles(newManga);
Severity: Minor
Found in js/background.js - About 4 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 refreshAllLasts has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function refreshAllLasts(refreshTimer, perform) {
    try {
        if (perform == undefined || perform == true) {
            console.log("Refreshing chapters at " + new Date());
            localStorage["lastChaptersUpdate"] = new Date().getTime();
Severity: Minor
Found in js/background.js - About 4 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 getModifsText has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function getModifsText(mg) {
  var lstres = [];
  if (mg.change == "new") {
    lstres[lstres.length] = {button: "img/add.png", text: "This manga will be added in your list."};
  } else if (mg.change == "delete") {
Severity: Minor
Found in js/listmanager.js - About 4 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 initPage has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function initPage() {
  //console.log("initPage");
  if (getMirrorScript().isCurrentPageAChapterPage(document, window.location.href)) {
     setKeys();
     //console.log("found mirror for current page");
Severity: Major
Found in js/back.js - About 3 hrs to fix

Function filter has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

function filter() {
    "use strict";
    var isOk = true,
        tmpLst = [],
        found = false,
Severity: Minor
Found in js/bookmarks.js - About 3 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 bindCategories has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function bindCategories() {
  "use strict";
  $(".category.include").each(function (ind) {
    $(this).attr("title", "All mangas in category " + $(this).text().trim() + " are included in the list.");
  });
Severity: Major
Found in js/popup.js - About 3 hrs to fix

Function createBar has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createBar(barVis) {
  var div = $("<div id='AMRBar'></div>");
  var divIn = $("<div id='AMRBarIn'></div>");

  var img = $("<img src='" + chrome.extension.getURL("img/icon-32.png") + "' width='20px;'/>");
Severity: Major
Found in js/back.js - About 3 hrs to fix

Function createMangaEntryList has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function createMangaEntryList(mangas, where) {
  "use strict";
  var isRead = false;
  var isUpdate = true;
  if (mangas.length) {
Severity: Minor
Found in js/popup.js - About 3 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 moveMangaElement has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function moveMangaElement(elt) {
  "use strict";
  var eltAfter = null;
  var toMove;
  var isplaceOk = true;
Severity: Minor
Found in js/popup.js - About 3 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 activateMirror has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function activateMirror(mirrorName) {
    var states = localStorage["mirrorStates"];
    var lstTmp = JSON.parse(states);
    if (lstTmp.length > 0) {
        for (var j = 0; j < lstTmp.length; j++) {
Severity: Minor
Found in js/background.js - About 3 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 initMirrorState has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function initMirrorState() {
    var states = localStorage["mirrorStates"];
    if (states == undefined || states == null || states == "null") {
        instantiateMirrors();
    } else {
Severity: Minor
Found in js/background.js - About 3 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 removeMangaParent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function removeMangaParent(elt) {
  "use strict";
  if (isInGroup(elt)) {
    if (nbOfGroup(elt) === 1) {
      elt.closest(".manga").toggle("blind", {}, 500, function () {
Severity: Minor
Found in js/popup.js - About 3 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 loadSelectors has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loadSelectors() {
    var selAll = $("<img src='" + chrome.extension.getURL("img/select_all.png") + "' title='Select all'/>");
    var selNone = $("<img src='" + chrome.extension.getURL("img/select_none.png") + "' title='Select none'/>");
    var selUsed = $("<img src='" + chrome.extension.getURL("img/bookmark.png") + "' title='Select all on which i have at least one manga in my list'/>");
    selAll.click(function () {
Severity: Major
Found in js/popupSearch.js - About 3 hrs to fix

Function renderManga has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderManga(lstBms) {
    "use strict";
    var divChaps,
        divScans,
        parity = 0,
Severity: Major
Found in js/bookmarks.js - About 3 hrs to fix

Function refreshLast has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.refreshLast = function (doSave, callback) {
    if (this.update === 1) {
      //Refresh the last existing chapter of this manga
      if (!doSave) {
        doSave = true;
Severity: Major
Found in js/MangaElt.js - About 3 hrs to fix

Function dragCatManga has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function dragCatManga(mg, _cat) {
  "use strict";
  if (isInGroup(mg)) {
    var obj = {
      action : "addCategories",
Severity: Major
Found in js/popup.js - About 3 hrs to fix

Function nodeToXML has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function nodeToXML(node, indentation, out) {
  "use strict";
  var item,
    value,
    i;
Severity: Minor
Found in js/dev.js - About 3 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 nodeToXML has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function nodeToXML(node, indentation, out) {
  "use strict";
  var value,
    item,
    i;
Severity: Minor
Found in js/faq.js - About 3 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 updateWebsitesFromRepository has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function updateWebsitesFromRepository(callback) {
  "use strict";
  $.ajax({
     type: 'GET',
     url: amrc_repository + "websites.json",
Severity: Major
Found in js/mgEntry.js - About 3 hrs to fix

File mgUtil.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**

This file is part of All Mangas Reader.

All Mangas Reader is free software: you can redistribute it and/or modify
Severity: Minor
Found in js/mgUtil.js - About 3 hrs to fix
Severity
Category
Status
Source
Language