AllMangasReader-dev/AMR

View on GitHub

Showing 292 of 636 total issues

File options.js has 439 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/options.js - About 6 hrs to fix

Function init has 158 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function init() {
    getMirrors(function (mirrorsT) {
        mirrors = mirrorsT,
        i;
        var doDeleteMirs = false;
Severity: Major
Found in js/background.js - About 6 hrs to fix

Function restore_mirrors has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

function restore_mirrors() {
  "use strict";
  mirrors = chrome.extension.getBackgroundPage().mirrors || [];
  mangas = chrome.extension.getBackgroundPage().mangaList || [];
  actmirrors = chrome.extension.getBackgroundPage().actMirrors || [];
Severity: Minor
Found in js/options.js - About 6 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 bindCatsButtons has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function bindCatsButtons() {
  "use strict";
  $(".actcatview").unbind();
  $(".actcatview").click(function (event) {
    $(".category:not(.addcategory):not(.newcat):not(.clearcategory)").removeClass("include").removeClass("exclude");
Severity: Major
Found in js/popup.js - About 5 hrs to fix

Function createMangaEntryBlock has 145 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createMangaEntryBlock(mangas, where) {
  "use strict";
  var isRead = false;
  var isUpdate = true;
  if (mangas.length) {
Severity: Major
Found in js/popup.js - About 5 hrs to fix

Function save_options has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

function save_options() {
  "use strict";

  var obj = {},
    colPicks = $(".colorPicker");
Severity: Minor
Found in js/options.js - About 5 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 onLoadImage has 135 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function onLoadImage() {
  if ($(this).data("canvasId")) {
    var width, height;
    var ancCan = $("#" + $(this).data("canvasId"));

Severity: Major
Found in js/back.js - About 5 hrs to fix

Function transformImagesInBook has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function transformImagesInBook(where, mode, res){
   //mode = 1 --> images are displayed on top of one another
   //mode = 2 --> images are displayed two by two occidental reading mode
   //mode = 3 --> images are displayed two by two japanese reading mode

Severity: Major
Found in js/back.js - About 5 hrs to fix

Function mergeLists has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function mergeLists(server, exten) {
  var lstres = [];
  
  setChapNoTot(server);
  setChapNoTot(exten);
Severity: Major
Found in js/listmanager.js - About 5 hrs to fix

Function addMultipleMangas has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

function addMultipleMangas(mgs, where) {
  var hasChanges = false;
  for (var i = 0; i < mgs.length; i++) {
    if (mgs[i].change) {
      hasChanges = true;
Severity: Minor
Found in js/listmanager.js - About 5 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 onLoadImage has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

function onLoadImage() {
  if ($(this).data("canvasId")) {
    var width, height;
    var ancCan = $("#" + $(this).data("canvasId"));

Severity: Minor
Found in js/back.js - About 5 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 updateFromSite has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

function updateFromSite(mangas, merge) {
    if (!merge) {
        var deleteAr = [];
        for (var i = 0; i < mangaList.length; i++) {
            deleteAr[deleteAr.length] = i;
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 setKeys has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function setKeys() {
  //disable default websites shortcuts (mangafox)
  document.onkeypress=null;
  document.onkeydown=null;
  document.onkeyup=null;
Severity: Major
Found in js/back.js - About 4 hrs to fix

Function loadSearch has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

function loadSearch(td, toSearch) {
  td.data("nbToLoad", mirrors.length);
  td.data("ancNbToLoad", mirrors.length);
  $(".amrfind", td).attr("src", chrome.extension.getURL("img/load16.gif"));
  $(".amrfind", td).unbind("click");
Severity: Minor
Found in js/backsite.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

File BSync.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This code will be changed for the storage.sync call of Chrome.
function BSync (_opt) {

    this.options = {};

Severity: Minor
Found in js/BSync.js - About 4 hrs to fix

Function refreshTag has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

function refreshTag() {
    var nbNews = 0;
    var listDone = [];
    for (var i = 0; i < mangaList.length; i++) {
        if (mangaList[i].listChaps.length > 0) {
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 createMangaEntryList has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createMangaEntryList(mangas, where) {
  "use strict";
  var isRead = false;
  var isUpdate = true;
  if (mangas.length) {
Severity: Major
Found in js/popup.js - About 4 hrs to fix

Function onRead has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    onRead : function (json, bookmark) {
      console.log('Reading incoming synchronisation');

      if (!(json == undefined || json == null || json == "null")) {
        console.log(' - Updating incoming entries');
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 restore_mirrors has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function restore_mirrors() {
  "use strict";
  mirrors = chrome.extension.getBackgroundPage().mirrors || [];
  mangas = chrome.extension.getBackgroundPage().mangaList || [];
  actmirrors = chrome.extension.getBackgroundPage().actMirrors || [];
Severity: Major
Found in js/options.js - About 4 hrs to fix

Function createMangaEntryBlock has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function createMangaEntryBlock(mangas, where) {
  "use strict";
  var isRead = false;
  var isUpdate = true;
  if (mangas.length) {
Severity: Minor
Found in js/popup.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

Severity
Category
Status
Source
Language