AllMangasReader-dev/AMR

View on GitHub
js/back.js

Summary

Maintainability
F
3 wks
Test Coverage

File back.js has 1448 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: Major
Found in js/back.js - About 3 days to fix

Function writeNavigation has 213 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function writeNavigation(where, select, res, params) {
    "use strict";
    var div = $("<div id='bookmarkPop' style='display:none'></div>"),
        btn = $("<a id='saveBtnAMR' class='buttonAMR'>Save</a>");
    $("<h3>Bookmark</h3>").appendTo(div);
Severity: Major
Found in js/back.js - About 1 day to fix

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 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 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 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 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 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 topbotVis has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function topbotVis(spanFimg) {
  var isTopVisible = true;
  var isBotVisible = true;
  var fTop = $("img:visible", $(spanFimg)).sort(function(a, b) {
    var aTop = a.offsetTop + a.offsetParent.offsetTop;
Severity: Minor
Found in js/back.js - About 1 hr 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 waitForImages has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function waitForImages(where, mode, res, title){
  isOk = true;
  var nbOk = 0;
  var nbTot = 0;
  $(".imageAMR", where).each(function (index) {
Severity: Minor
Found in js/back.js - About 1 hr to fix

Function onLoadNextImage has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function onLoadNextImage() {
  var lstbtn = [];
  var id = "nChapBtn";
  var i = 0;
  while ($("#" + id + i).size() > 0) {
Severity: Minor
Found in js/back.js - About 1 hr to fix

Function add_bookmark_button has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function add_bookmark_button () {
    "use strict";
    var obj = {
        action: "addUpdateBookmark",
        mirror: $("#bookmarkData").data("mirror"),
Severity: Minor
Found in js/back.js - About 1 hr to fix

Function writeImages has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function writeImages(where, list, mode, res) {
   var table = $("<table class='AMRtable'></table>");
   table.css("text-align", "center");
   table.css("position", "static");
   table.css("width", "100%");
Severity: Minor
Found in js/back.js - About 1 hr to fix

Function sendExtRequest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function sendExtRequest(request, button, callback, backsrc) {
  //Prevent a second request
  if (button.data("currentlyClicked")) return;
  button.data("currentlyClicked", true);

Severity: Minor
Found in js/back.js - About 1 hr to fix

Function bindCalculateTime has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function bindCalculateTime() {
  window.onbeforeunload = function() {
    if (isActive) {
      var now = new Date().getTime();
      if (debugTimes) times[times.length] = now - starttime;
Severity: Minor
Found in js/back.js - About 1 hr to fix

Function bindCalculateTime has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function bindCalculateTime() {
  window.onbeforeunload = function() {
    if (isActive) {
      var now = new Date().getTime();
      if (debugTimes) times[times.length] = now - starttime;
Severity: Minor
Found in js/back.js - About 1 hr 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 transformImagesInBook has a Cognitive Complexity of 10 (exceeds 5 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: Minor
Found in js/back.js - About 1 hr 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 onErrorImage has a Cognitive Complexity of 9 (exceeds 5 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: Minor
Found in js/back.js - About 55 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 waitForImages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function waitForImages(where, mode, res, title){
  isOk = true;
  var nbOk = 0;
  var nbTot = 0;
  $(".imageAMR", where).each(function (index) {
Severity: Minor
Found in js/back.js - About 55 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 loadImageAMR has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

function loadImageAMR(where, url, img, pos, res, mode, second) {
Severity: Major
Found in js/back.js - About 50 mins to fix

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

function sendExtRequest(request, button, callback, backsrc) {
  //Prevent a second request
  if (button.data("currentlyClicked")) return;
  button.data("currentlyClicked", true);

Severity: Minor
Found in js/back.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 (posImg[i] != 2) {
              posImg[i] = (posImg[i]+1) % 2;
            }
Severity: Major
Found in js/back.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if ($(this).data("order") == nb) {
                $.scrollTo($(this).closest("tr")[0], 800, {queue:true});
              }
Severity: Major
Found in js/back.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

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 (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 (!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

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 loadImageAMR has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function loadImageAMR(where, url, img, pos, res, mode, second) {
  if (!second) {
    $(img).data("urlToLoad", url);
    $(img).data("resize", res.resize);
    $(img).data("modedisplay", mode);
Severity: Minor
Found in js/back.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 add_bookmark_button has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function add_bookmark_button () {
    "use strict";
    var obj = {
        action: "addUpdateBookmark",
        mirror: $("#bookmarkData").data("mirror"),
Severity: Minor
Found in js/back.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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function zoomin(){
  var ancheight = document.body.offsetHeight - getTopPlus();
  $(".imageAMR").each(function(index) {
    if ($(this).data("zoom")) {
      $(this).data("zoom", $(this).data("zoom") * 1.2);
Severity: Major
Found in js/back.js and 1 other location - About 1 day to fix
js/back.js on lines 1374..1391

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 258.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function zoomout(){
  var ancheight = document.body.offsetHeight - getTopPlus();
  $(".imageAMR").each(function(index) {
    if ($(this).data("zoom")) {
      $(this).data("zoom", $(this).data("zoom") * 0.833);
Severity: Major
Found in js/back.js and 1 other location - About 1 day to fix
js/back.js on lines 1355..1372

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 258.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  if ($("#bookmarkData").data("type") == "chapter") {
    textDesc = "Bookmark chapter '" + $("#bookmarkData").data("chapName") + "' of '" + $("#bookmarkData").data("name") + "' on '" + $("#bookmarkData").data("mirror");
    textDesc += "'. You can add notes below which will be associated with this bookmark.";
  } else {
    textDesc = "Bookmark scan '" + $("#bookmarkData").data("scanName") + "' of chapter '" + $("#bookmarkData").data("chapName") + "' of '" + $("#bookmarkData").data("name") + "' on '" + $("#bookmarkData").data("mirror");
Severity: Major
Found in js/back.js and 1 other location - About 7 hrs to fix
js/bookmarks.js on lines 119..125

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 187.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  if (button.is("img")) {
    _ancSrc = button.attr("src");
    button.attr("src", chrome.extension.getURL("img/load16.gif"));
  } else {
    if (button.is(".button")) {
Severity: Major
Found in js/back.js and 3 other locations - About 7 hrs to fix
js/backamrc.js on lines 76..88
js/importexport.js on lines 27..39
js/options.js on lines 219..231

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 186.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    var obj = {
                        "action": "readManga",
                        "url": $(this).data("mangainfo").currentMangaURL,
                        "mirror": getMirrorScript().mirrorName,
                        "lastChapterReadName": $(this).data("mangainfo").currentChapter,
Severity: Major
Found in js/back.js and 1 other location - About 3 hrs to fix
js/back.js on lines 580..587

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 109.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    var obj = {
                        "action": "setMangaChapter",
                        "url": $(this).data("mangainfo").currentMangaURL,
                        "mirror": getMirrorScript().mirrorName,
                        "lastChapterReadName": $(this).data("mangainfo").currentChapter,
Severity: Major
Found in js/back.js and 1 other location - About 3 hrs to fix
js/back.js on lines 598..605

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 109.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      } else if (needFirst) {
        //return the first scan of the last visible tr
        resp = $(".spanForImg", $(this)).sort(function(a, b) {
          var nba = $(a).data("order");
          var nbb = $(b).data("order");
Severity: Major
Found in js/back.js and 1 other location - About 3 hrs to fix
js/back.js on lines 1622..1636

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (!needFirst && resp === null) {
        //Return the last scan of the first visible tr
        resp = $(".spanForImg", $(this)).sort(function(a, b) {
          var nba = $(a).data("order");
          var nbb = $(b).data("order");
Severity: Major
Found in js/back.js and 1 other location - About 3 hrs to fix
js/back.js on lines 1629..1636

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

      if (mode == 2) {
        evenImg.appendTo(trTmp);
        evenImg.css("text-align", "right");
        td.appendTo(trTmp);
        td.css("text-align", "left");
Severity: Major
Found in js/back.js and 1 other location - About 3 hrs to fix
js/back.js on lines 1211..1221

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

          if (mode == 2) {
            evenImg.appendTo(trTmp);
            evenImg.css("text-align", "right");
            td.appendTo(trTmp);
            td.css("text-align", "left");
Severity: Major
Found in js/back.js and 1 other location - About 3 hrs to fix
js/back.js on lines 1255..1265

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 107.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            $(".spanForImg").each(function(index) {
              if ($(this).data("order") == nb) {
                $.scrollTo($(this).closest("tr")[0], 800, {queue:true});
              }
            });
Severity: Major
Found in js/back.js and 1 other location - About 2 hrs to fix
js/back.js on lines 1528..1532

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                  $(".spanForImg").each(function(index) {
                    if ($(this).data("order") == nb) {
                      $.scrollTo($(this).closest("tr")[0], 800, {queue:true});
                    }
                  });
Severity: Major
Found in js/back.js and 1 other location - About 2 hrs to fix
js/back.js on lines 1498..1502

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        $("#AMRBarIn").fadeOut('fast', function() {
          $("#AMRBar").css("text-align", "left");
          $("#AMRBarInLtl").fadeIn(function() {
            $(this).css("display", "inline-block");
          });
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 267..272

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        $("#AMRBarIn").fadeOut('fast', function() {
          $("#AMRBar").css("text-align", "left");
          $("#AMRBarInLtl").fadeIn(function() {
            $(this).css("display", "inline-block");
          });
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 236..241

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (e.which == 66) { //b
        if ($("#pChapBtn0").size()>0) {
          window.location.href = $("#pChapBtn0").attr("href");
        }
      }
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 1441..1445

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (e.which == 78) { //n
        if ($("#nChapBtn0").size()>0) {
          window.location.href = $("#nChapBtn0").attr("href");
        }
      }
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 1436..1440

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      if (ancCan.width() < ancCan.height()) {
        if (mode != 1) {
          if (ancCan.width() > (screen.width-200) / 2) {
            width = (screen.width-200) / 2;
          } else {
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 733..745

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (mode != 1) {
          if (ancCan.width() > (screen.width-200) / 2) {
            width = (screen.width-200) / 2;
          } else {
            width = ancCan.width();
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 732..752

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                var statobj = {"action": "readMgForStat",
                           "url": res.currentMangaURL,
                           "mirror": getMirrorScript().mirrorName,
                           "lastChapterReadName": res.currentChapter,
                           "lastChapterReadURL": res.currentChapterURL,
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 119..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                var obj = {"action": "readManga",
                           "url": res.currentMangaURL,
                           "mirror": getMirrorScript().mirrorName,
                           "lastChapterReadName": res.currentChapter,
                           "lastChapterReadURL": res.currentChapterURL,
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 138..143

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          if (lastpresstime !== undefined && new Date().getTime() - lastpresstime < 500 && dirpress !== undefined && dirpress == 1) {
            doubleTap = true;
          }
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 1490..1492

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          if (lastpresstime !== undefined && new Date().getTime() - lastpresstime < 500 && dirpress !== undefined && dirpress == 2) {
            doubleTap = true;
          }
Severity: Major
Found in js/back.js and 1 other location - About 1 hr to fix
js/back.js on lines 1454..1456

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

      if (res.resize == 1) {
        if (!divMode) $("img", trTmp).css("max-width", ((screen.width-200) / 2) + 'px');
      }
Severity: Major
Found in js/back.js and 2 other locations - About 55 mins to fix
js/back.js on lines 1222..1224
js/back.js on lines 1234..1236

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            if (res.resize == 1) {
              if (!divMode) $("img", trTmp).css("max-width", ((screen.width-200) / 2) + 'px');
            }
Severity: Major
Found in js/back.js and 2 other locations - About 55 mins to fix
js/back.js on lines 1222..1224
js/back.js on lines 1266..1268

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

          if (res.resize == 1) {
            if (!divMode) $("img", trTmp).css("max-width", ((screen.width-200) / 2) + 'px');
          }
Severity: Major
Found in js/back.js and 2 other locations - About 55 mins to fix
js/back.js on lines 1234..1236
js/back.js on lines 1266..1268

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

      $("#AMRBarInLtl").fadeOut('fast', function() {
        $("#AMRBar").css("text-align", "center");
        $("#AMRBarIn").fadeIn();
      });
Severity: Minor
Found in js/back.js and 1 other location - About 50 mins to fix
js/back.js on lines 231..234

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        $("#AMRBarInLtl").fadeOut('fast', function() {
          $("#AMRBar").css("text-align", "center");
          $("#AMRBarIn").fadeIn();
        });
Severity: Minor
Found in js/back.js and 1 other location - About 50 mins to fix
js/back.js on lines 253..256

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (res.resize == 1) {
          if (!divMode) $("img", trTmp).css("max-width", (screen.width-200) + 'px');
        }
Severity: Minor
Found in js/back.js and 1 other location - About 45 mins to fix
js/back.js on lines 1196..1198

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          if (res.resize == 1) {
            if (!divMode) $("img", trForEven).css("max-width", (screen.width-200) + 'px');
          }
Severity: Minor
Found in js/back.js and 1 other location - About 45 mins to fix
js/back.js on lines 1204..1206

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  $(img).css("height", $(img).data("zoom") * $(img).data("baseheight") + "px");
Severity: Minor
Found in js/back.js and 1 other location - About 40 mins to fix
js/back.js on lines 1340..1340

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                    } else if (mdnext == 2) {
                        $(_butMode).attr("src", chrome.extension.getURL("img/righttoleft.png"));
                        $(_butMode).attr("title", "Scans displayed as a book in occidental mode (left to right) (click to switch display mode for this manga only)");
                    } else {
                        $(_butMode).attr("src", chrome.extension.getURL("img/lefttoright.png"));
Severity: Minor
Found in js/back.js and 2 other locations - About 40 mins to fix
js/back.js on lines 518..524
js/back.js on lines 557..566

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                    if (curRead) {
                        $(_but).attr("src", chrome.extension.getURL("img/read_stop.png"));
                        $(_but).attr("title", "Stop following updates for this manga");
                    } else {
                        $(_but).attr("src", chrome.extension.getURL("img/read_play.png"));
Severity: Minor
Found in js/back.js and 2 other locations - About 40 mins to fix
js/back.js on lines 557..566
js/back.js on lines 560..566

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                    if (mdnext == 1) {
                        $(_butMode).attr("src", chrome.extension.getURL("img/ontop.png"));
                        $(_butMode).attr("title", "Scans displayed on top of each other (click to switch display mode for this manga only)");
                    } else if (mdnext == 2) {
                        $(_butMode).attr("src", chrome.extension.getURL("img/righttoleft.png"));
Severity: Minor
Found in js/back.js and 2 other locations - About 40 mins to fix
js/back.js on lines 518..524
js/back.js on lines 560..566

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  $(img).css("width", $(img).data("zoom") * $(img).data("basewidth") + "px");
Severity: Minor
Found in js/back.js and 1 other location - About 40 mins to fix
js/back.js on lines 1339..1339

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        var t = Math.floor((width / ancCan.width()) * $(this).position().top);
Severity: Minor
Found in js/back.js and 1 other location - About 30 mins to fix
js/back.js on lines 778..778

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        var l = Math.floor((width / ancCan.width()) * $(this).position().left);
Severity: Minor
Found in js/back.js and 1 other location - About 30 mins to fix
js/back.js on lines 780..780

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status