AllMangasReader-dev/AMR

View on GitHub
js/listmanager.js

Summary

Maintainability
F
2 wks
Test Coverage

Function mergeLists has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
Open

function mergeLists(server, exten) {
  var lstres = [];
  
  setChapNoTot(server);
  setChapNoTot(exten);
Severity: Minor
Found in js/listmanager.js - About 2 days 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 listmanager.js has 849 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/listmanager.js - About 2 days to fix

Function displayList has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

function displayList(lst, updtSrv, where, noinfo) {
  if (where == undefined) {
    where = $("#mangalist");
  }
  if (noinfo == undefined) {
Severity: Minor
Found in js/listmanager.js - About 1 day 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 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 getModifsText has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function getModifsText(mg) {
  var lstres = [];
  if (mg.change == "new") {
    lstres[lstres.length] = {button: "img/add.png", text: "This manga will be added in your list."};
  } else if (mg.change == "delete") {
Severity: Minor
Found in js/listmanager.js - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

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

Function bindActions has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function bindActions() {
  $(".mgLst tbody tr").click(function(e) {
    if (event.target.type !== 'checkbox') {
      var ck = $(".checker input", $(this));
      ck[0].checked = !ck[0].checked;
Severity: Major
Found in js/listmanager.js - About 2 hrs to fix

Function addSingleManga has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function addSingleManga(mg, where) {
  if (mg.change) {
    var mirroricon = getIcon(mg.mirror);
    var trSingle = $("<tr class=\"mangaentry single info" + (mg.read == 1 ? " read" : (isNew(mg) ? " new": "")) + "\"><td class=\"checker\"><input type=\"checkbox\" checked=\"checked\"/></td><td class=\"mirroricon\"><img src=\"" + mirroricon + "\" title=\"" + mg.mirror + "\"/></td><td class=\"chapter\" colspan=\"2\"><a class=\"title link\" onclick=\"openLink('" + mg.url + "');\">" + mg.name + "</a>&nbsp; - <a class=\"chapter link\" onclick=\"openLink('" + mg.lastChapterReadURL + "');\">" + mg.lastChapterReadName + "</a></td><td class=\"progression\"></td></tr>");
    trSingle.appendTo(where);
Severity: Minor
Found in js/listmanager.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function setChapNoTot has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function setChapNoTot(lst) {
  if (lst.length > 0) {
    for (var i = 0; i < lst.length; i++) {
      if (!lst[i].chapno) {
        lst[i].chapno = findChapNo(lst[i]);
Severity: Minor
Found in js/listmanager.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function replaceServerList has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function replaceServerList(callback) {
  if (confirm("Are you sure to replace your online manga list with your local one ?")) {
    var toSend = [];
    chrome.runtime.sendMessage({action: "mangaList"}, function(res) {
      var exten = res.lst;
Severity: Minor
Found in js/listmanager.js - About 2 hrs to fix

Function clickOnUpdate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function clickOnUpdate() {
  //Get extension list
  var mglstext;
  var _self = this;
  chrome.runtime.sendMessage({action: "mangaList"}, function(res) {
Severity: Minor
Found in js/listmanager.js - About 1 hr to fix

Function getAndRemoveConflictualEntries has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function getAndRemoveConflictualEntries(outgoing, incoming) {
  var removeIncome = [];
  var removeOutgoing = [];
  var conflicts = [];
  
Severity: Minor
Found in js/listmanager.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 addMultipleMangas has 39 lines of code (exceeds 25 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 1 hr to fix

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

function sortList(mangas) {
  //Sort by name
  sortByShortName(mangas);
  
  //Build groups
Severity: Minor
Found in js/listmanager.js - About 1 hr to fix

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

function getAndRemoveConflictualEntries(outgoing, incoming) {
  var removeIncome = [];
  var removeOutgoing = [];
  var conflicts = [];
  
Severity: Minor
Found in js/listmanager.js - About 1 hr to fix

Function getModifsText has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getModifsText(mg) {
  var lstres = [];
  if (mg.change == "new") {
    lstres[lstres.length] = {button: "img/add.png", text: "This manga will be added in your list."};
  } else if (mg.change == "delete") {
Severity: Minor
Found in js/listmanager.js - About 1 hr to fix

Function validateUpdateServer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function validateUpdateServer(callback) {
  var toSend = [];
  $(".mangaentry.info").each(function() {
    if ($(".checker input", $(this))[0].checked) {
      toSend[toSend.length] = $(this).data("mangainfo");
Severity: Minor
Found in js/listmanager.js - About 1 hr to fix

Function sortList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function sortList(mangas) {
  //Sort by name
  sortByShortName(mangas);
  
  //Build groups
Severity: Minor
Found in js/listmanager.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

Avoid deeply nested control flow statements.
Open

          if (lst[i].change) {
            hasChanges = true;
          }
Severity: Major
Found in js/listmanager.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

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

Avoid deeply nested control flow statements.
Open

          for (var j = 0; j < lst[i].length; j++) {
            if (lst[i][j].change) {
              hasChanges = true;
            }
          }
Severity: Major
Found in js/listmanager.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

          if (foundEx.nbchaps > 0 && (foundEx.nbchaps != server[i].nbchaps || foundEx.chapno != server[i].chapno)) {
            lstChanges[lstChanges.length] = "newunread";
            toAdd.oldchapno = server[i].chapno;
            toAdd.oldnbchaps = server[i].nbchaps;
            toAdd.chapno = foundEx.chapno;
Severity: Major
Found in js/listmanager.js - About 45 mins to fix

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

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

Avoid too many return statements within this function.
Open

      else return -1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return -1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return -1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return 3
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      if (a.shortName >  b.shortName) return 1;
Severity: Major
Found in js/listmanager.js - About 30 mins to fix

Function createProgression has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function createProgression(nb, nbTot, where, hideText) {
  var value = 0;
  if (nb != nbTot) {
    if (nbTot < 2) {
      value = 100;
Severity: Minor
Found in js/listmanager.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 findChapNo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function findChapNo(extobj) {
  var pos = 0;
  if (extobj.listChaps != undefined) {
    for (var i = 0; i < extobj.listChaps.length; i++) {
      if (extobj.listChaps[i][1] == extobj.lastChapterReadURL) {
Severity: Minor
Found in js/listmanager.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 findRealName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function findRealName(extobj) {
  var res = "";
  if (extobj.listChaps != undefined) {
    for (var i = 0; i < extobj.listChaps.length; i++) {
      if (extobj.listChaps[i][1] == extobj.lastChapterReadURL) {
Severity: Minor
Found in js/listmanager.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 sortByNewShortName(lst) {
  lst.sort(function(aG, bG) {
    var a, b;
    if (aG.length) {a = aG[0];} else {a = aG;}
    if (bG.length) {b = bG[0];} else {b = bG;}
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 day to fix
js/popup.js on lines 1269..1308

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 294.

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 (updtServ == 0 || updtServ == 2) {
      $("#mangalist").after($("<div class=\"rightbut validationamr\"><a class=\"button validateamr tip\">Validate<span>Click here to send the selected updates online.</span></a>&nbsp;&nbsp;<a class=\"button cancelamr tip\" onclick=\"loadList();\">Cancel<span>Back to your online list</span></a></div>"));
      
      $(".globalamractions").hide();
      $(".validateamr").click(function() {onButtonClickAsync($(this), validateUpdateServer);});
Severity: Major
Found in js/listmanager.js and 1 other location - About 7 hrs to fix
js/listmanager.js on lines 100..163

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 182.

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 (updtServ == 1) {
      $("#mangalist").after($("<div class=\"rightbut validationamr\"><a class=\"button validateamr tip\">Validate<span>Click here to update you local list with these changes.</span></a>&nbsp;&nbsp;<a class=\"button cancelamr tip\" onclick=\"loadList();\">Cancel<span>Back to your online list</span></a></div>"));
      
      $(".globalamractions").hide();
      $(".validateamr").click(function() {onButtonClickAsync($(this), validateUpdateExt);});
Severity: Major
Found in js/listmanager.js and 1 other location - About 7 hrs to fix
js/listmanager.js on lines 83..163

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 182.

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 sortByShortName(lst) {
  lst.sort(function(a, b) {
    if (!a.shortName) a.shortName = formatMgName(a.name);
    if (!b.shortName) b.shortName = formatMgName(b.name);

Severity: Major
Found in js/listmanager.js and 1 other location - About 6 hrs to fix
js/popup.js on lines 1309..1330

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 170.

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 ($(this).text().indexOf("var mglistaccount") != -1) {
      var pos = $(this).text().indexOf("var mglistaccount");
      var end = $(this).text().indexOf("];", pos);
      eval($(this).text().substring(pos, end+2));
      mglstacc = mglistaccount;
Severity: Major
Found in js/listmanager.js and 1 other location - About 4 hrs to fix
js/listmanager.js on lines 45..50

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 123.

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 ($(this).text().indexOf("var mglistsync") != -1) {
      var pos = $(this).text().indexOf("var mglistsync");
      var end = $(this).text().indexOf(";", pos);
      eval($(this).text().substring(pos, end+1));
      tsacc = mglistsync;
Severity: Major
Found in js/listmanager.js and 1 other location - About 4 hrs to fix
js/listmanager.js on lines 39..44

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 123.

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 sortByNewMirror(lst) {
  lst.sort(function(a, b) {
    var isNewA = isNew(a);
    var isNewB = isNew(b);
    
Severity: Major
Found in js/listmanager.js and 1 other location - About 3 hrs to fix
js/popup.js on lines 1331..1342

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 110.

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 (nbchecked == 0) {
        parentChecker.prop("checked", false);
        parentChecker.css("opacity", "1");
      } else if (nbunchecked == 0) {
        parentChecker.prop("checked", true);
Severity: Major
Found in js/listmanager.js and 1 other location - About 3 hrs to fix
js/listmanager.js on lines 735..744

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 99.

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 (nbchecked == 0) {
    parCheck.prop("checked", false);
    parCheck.css("opacity", "1");
  } else if (nbunchecked == 0) {
    parCheck.prop("checked", true);
Severity: Major
Found in js/listmanager.js and 1 other location - About 3 hrs to fix
js/listmanager.js on lines 699..708

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 99.

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

Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};
Severity: Major
Found in js/listmanager.js and 1 other location - About 2 hrs to fix
js/MangaElt.js on lines 29..34

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 77.

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 (foundEx.read != server[i].read) {
          lstChanges[lstChanges.length] = "read";
          toAdd.oldread = server[i].read;
          toAdd.read = foundEx.read;
        }
Severity: Major
Found in js/listmanager.js and 1 other location - About 2 hrs to fix
js/listmanager.js on lines 296..300

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 76.

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 (foundEx.display != server[i].display) {
          lstChanges[lstChanges.length] = "display";
          toAdd.olddisplay = server[i].display;
          toAdd.display = foundEx.display;
        }
Severity: Major
Found in js/listmanager.js and 1 other location - About 2 hrs to fix
js/listmanager.js on lines 290..294

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 76.

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 (mgTemp.length == 1) {
    mangasGrps[mangasGrps.length] = mgTemp[0];
  } else {
    //Sort by new inside group
    sortByNewMirror(mgTemp);
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 hr to fix
js/listmanager.js on lines 413..423

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 70.

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 (mgTemp.length == 1) {
        mangasGrps[mangasGrps.length] = mgTemp[0];
      } else {
        //Sort by new inside group
        sortByNewMirror(mgTemp);
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 hr to fix
js/listmanager.js on lines 431..441

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 70.

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 formatMgName(name) {
  if (name == undefined || name == null || name == "null") return "";
  return name.trim().replace(/[^0-9A-Za-z]/g, '').toUpperCase();
}
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 hr to fix
js/backsite.js on lines 169..172

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 64.

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 (nb != nbTot) {
    if (nbTot < 2) {
      value = 100;
    } else {
      value = Math.floor((nbTot - 1 - nb) * 100 / (nbTot - 1));
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 hr to fix
js/popup.js on lines 338..344

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

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

        if (exten[i].lastChapterReadName != undefined) {
          newentry.lastChapterReadName = exten[i].lastChapterReadName;
        } else {
          newentry.lastChapterReadName = findRealName(exten[i]);
        }
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 hr to fix
js/listmanager.js on lines 948..952

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

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

        if (exten[i].lastChapterReadName != undefined) {
          newentry.lastChapterReadName = exten[i].lastChapterReadName;
        } else {
          newentry.lastChapterReadName = findRealName(exten[i]);
        }
Severity: Major
Found in js/listmanager.js and 1 other location - About 1 hr to fix
js/listmanager.js on lines 383..387

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

    chrome.runtime.sendMessage({action: "replaceFromSite", ts: tsacc, lst: toSend}, function() {
      window.location.href = "/accountlist.php?act=down";
    });
Severity: Minor
Found in js/listmanager.js and 1 other location - About 50 mins to fix
js/listmanager.js on lines 930..932

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 8 locations. Consider refactoring.
Open

    for (var i = removeOutgoing.length - 1; i >= 0; i--) {
      outgoing.remove(removeOutgoing[i], removeOutgoing[i]);  
    }
Severity: Major
Found in js/listmanager.js and 7 other locations - About 50 mins to fix
js/background.js on lines 129..131
js/background.js on lines 1948..1950
js/background.js on lines 1965..1967
js/background.js on lines 2009..2011
js/background.js on lines 2059..2061
js/listmanager.js on lines 198..200
js/popupSearch.js on lines 423..425

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 8 locations. Consider refactoring.
Open

    for (var i = removeIncome.length - 1; i >= 0; i--) {
      incoming.remove(removeIncome[i], removeIncome[i]);  
    }
Severity: Major
Found in js/listmanager.js and 7 other locations - About 50 mins to fix
js/background.js on lines 129..131
js/background.js on lines 1948..1950
js/background.js on lines 1965..1967
js/background.js on lines 2009..2011
js/background.js on lines 2059..2061
js/listmanager.js on lines 205..207
js/popupSearch.js on lines 423..425

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

  chrome.runtime.sendMessage({action: "updateFromSite", ts: tsacc, lst: toSend}, function() {
    window.location.href = "/accountlist.php?ext=1";
  });
Severity: Minor
Found in js/listmanager.js and 1 other location - About 50 mins to fix
js/listmanager.js on lines 1017..1019

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 5 locations. Consider refactoring.
Open

        if (mg.updatemode[i] == "display") {
          lstres[lstres.length] = {button: "img/update.png", text: "Change display mode (right to left, left to right, on top)"};
        }
Severity: Major
Found in js/listmanager.js and 4 other locations - About 30 mins to fix
js/listmanager.js on lines 863..865
js/listmanager.js on lines 866..868
js/listmanager.js on lines 869..871
js/listmanager.js on lines 875..877

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 5 locations. Consider refactoring.
Open

        if (mg.updatemode[i] == "newunread") {
          lstres[lstres.length] = {button: "img/update.png", text: "The total number of chapters will be updated."};
        }
Severity: Major
Found in js/listmanager.js and 4 other locations - About 30 mins to fix
js/listmanager.js on lines 863..865
js/listmanager.js on lines 869..871
js/listmanager.js on lines 872..874
js/listmanager.js on lines 875..877

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 5 locations. Consider refactoring.
Open

        if (mg.updatemode[i] == "read") {
          lstres[lstres.length] = {button: "img/update.png", text: "Change reading mode (follow updates)"};
        }
Severity: Major
Found in js/listmanager.js and 4 other locations - About 30 mins to fix
js/listmanager.js on lines 863..865
js/listmanager.js on lines 866..868
js/listmanager.js on lines 872..874
js/listmanager.js on lines 875..877

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 5 locations. Consider refactoring.
Open

        if (mg.updatemode[i] == "chapter") {
          lstres[lstres.length] = {button: "img/update.png", text: "Your latest chapter read will be changed"};
        }
Severity: Major
Found in js/listmanager.js and 4 other locations - About 30 mins to fix
js/listmanager.js on lines 866..868
js/listmanager.js on lines 869..871
js/listmanager.js on lines 872..874
js/listmanager.js on lines 875..877

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 5 locations. Consider refactoring.
Open

        if (mg.updatemode[i] == "cats") {
          lstres[lstres.length] = {button: "img/update.png", text: "Change categories"};
        }
Severity: Major
Found in js/listmanager.js and 4 other locations - About 30 mins to fix
js/listmanager.js on lines 863..865
js/listmanager.js on lines 866..868
js/listmanager.js on lines 869..871
js/listmanager.js on lines 872..874

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