AllMangasReader-dev/AMR

View on GitHub

Showing 292 of 636 total issues

Avoid deeply nested control flow statements.
Open

          if (server[i].cats.length > 0) {
            if (foundEx.cats.length == 0) {
              isDiff = true;
            } else {
              for (var k = 0; k < server[i].cats.length; k++) {
Severity: Major
Found in js/listmanager.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if (!divMode) $("img", trTmp).css("max-width", ((screen.width-200) / 2) + 'px');
Severity: Major
Found in js/back.js - About 45 mins to fix

Function loadScript has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

jQuery.loadScript = function (url, arg1, arg2, errorfunc, datatyp) {
    "use strict";
    var cache = false,
        callback = null,
        load = true,
Severity: Minor
Found in js/jQuery.loadScript.js - About 45 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

Avoid deeply nested control flow statements.
Open

            if (window.pageYOffset >= document.documentElement.scrollHeight - window.innerHeight) {
              if (nextRight) {
                if ($("#nChapBtn0").size()>0) {
                  window.location.href = $("#nChapBtn0").attr("href");
                }
Severity: Major
Found in js/back.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

          if (ancCan.width() > (screen.width-200) / 2) {
            width = (screen.width-200) / 2;
          } else {
            width = ancCan.width();
          }
Severity: Major
Found in js/back.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (curimg !== null && curimg.size() > 0) {
              //Check if top and bottom of this image are visible
              viss = topbotVis(curimg[0]);
              //If bottom not visible
              if (!viss.bottomVis && !doubleTap) {
Severity: Major
Found in js/back.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (mangaList[i].cats[j] == request.cat) {
                        toRem[toRem.length] = j;
                    }
Severity: Major
Found in js/background.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (othMg.length > 0) {
                                for (var i = 0; i < othMg.length; i++) {
                                    othMg.update = request.update;
                                }
                                saveList();
Severity: Major
Found in js/background.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

          if (ancCan.width() > (screen.width-200)) {
            width = (screen.width-200);
          } else {
            width = ancCan.width();
          }
Severity: Major
Found in js/back.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

          if (server[i].cats.length > 0) {
            isDiff = true;
          }
Severity: Major
Found in js/listmanager.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (mangaList[i].cats[j] == request.cat) {
                        mangaList[i].cats[j] = request.newcat;
                    }
Severity: Major
Found in js/background.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (!viss.topVis && !doubleTap) {
              //Move to top of current scan
              $.scrollTo($(curimg).closest("tr")[0], 800, {queue:true});
            } else {
              //Calculate previous scan id
Severity: Major
Found in js/back.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (tab.url && tab.url === "https://github.com/AllMangasReader-dev/AMR/commits/develop") {
                                chrome.tabs.update(tab.id, {
                                    selected : true
                                });
                                return;
Severity: Major
Found in js/background.js - About 45 mins to fix

Function addResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function addResult(idTest, statut, testTxt, res, comment) {
Severity: Minor
Found in js/lab.js - About 35 mins to fix

Function loadScript has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

jQuery.loadScript = function (url, arg1, arg2, errorfunc, datatyp) {
Severity: Minor
Found in js/jQuery.loadScript.js - About 35 mins to fix

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

function getElementsByClass(searchClass, obj) {
    if (!obj) {
        obj = document;
    }

Severity: Minor
Found in js/lab.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

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

function getTimeSince(timeDif) {
  "use strict";
  var txt = "";
  if (timeDif !== undefined) {
    var tmpDif = (new Date().getTime() - timeDif) / 1000;
Severity: Minor
Found in js/popup.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

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

function callbackListChaps(list, select) {
  var hasSelected = false;
  for (var j = 0; j < list.length; j++) {
      var optTmp = $("<option value=\"" + list[j][1] + "\">" + list[j][0] + "</option>");
    if ($(select).data("mangaCurUrl").indexOf(list[j][1]) != - 1 && !hasSelected) {
Severity: Minor
Found in js/back.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

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

function updateServer(tsServer, tsExt, modifsInExt) {
  console.log("server : " + tsServer + " ext : " + tsExt + " hasModifs : " + modifsInExt);
  if (tsServer == 0) {
    return 0;
  } else {
Severity: Minor
Found in js/listmanager.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

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

function refreshSearchAll(toSearch) {
    isOver = false;
    tempMirrorListAll = [];
    nbToLoad = mirrors.length;
    ancNbToLoad = nbToLoad;
Severity: Minor
Found in js/popupSearch.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

Severity
Category
Status
Source
Language