XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/plugins/stablebit/js/stablebit.js

Summary

Maintainability
F
1 wk
Test Coverage

Function stablebit_buildTable has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

function stablebit_buildTable(xml) {
    var html = "", tree = [], closed = [];

    $("#Plugin_StableBit #Plugin_StableBitTable").remove();

Severity: Minor
Found in phpsysinfo/plugins/stablebit/js/stablebit.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 stablebit_buildTable has 128 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function stablebit_buildTable(xml) {
    var html = "", tree = [], closed = [];

    $("#Plugin_StableBit #Plugin_StableBitTable").remove();

Severity: Major
Found in phpsysinfo/plugins/stablebit/js/stablebit.js - About 5 hrs to fix

    Function stablebit_getdisks has 95 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $("Plugins Plugin_StableBit Disk", xml).each(function stablebit_getdisks(id) {
            var name = "";
            name = $(this).attr("Name");
            if (name !== undefined) {
                var serialnumber = "", firmware = "", size = 0, powerstate = "", temperaturec = "",
    Severity: Major
    Found in phpsysinfo/plugins/stablebit/js/stablebit.js - About 3 hrs to fix

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

      function stablebit_request() {
          $("#Reload_StableBitTable").attr("title", "reload");
          $.ajax({
              url: "xml.php?plugin=StableBit",
              dataType: "xml",
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 11 other locations - About 4 hrs to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 186..203
      phpsysinfo/plugins/docker/js/docker.js on lines 118..135
      phpsysinfo/plugins/hyperv/js/hyperv.js on lines 96..113
      phpsysinfo/plugins/iptables/js/iptables.js on lines 73..90
      phpsysinfo/plugins/pingtest/js/pingtest.js on lines 95..112
      phpsysinfo/plugins/ps/js/ps.js on lines 113..130
      phpsysinfo/plugins/psstatus/js/psstatus.js on lines 96..113
      phpsysinfo/plugins/quotas/js/quotas.js on lines 118..135
      phpsysinfo/plugins/raid/js/raid.js on lines 227..244
      phpsysinfo/plugins/snmppinfo/js/snmppinfo.js on lines 131..148
      phpsysinfo/plugins/uprecords/js/uprecords.js on lines 95..112

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

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

                  if ($(this).attr("IsHot") !== undefined) {
                      ishot = parseInt($(this).attr("IsHot"), 10);
                      if (!isNaN(ishot) && (ishot === 1)) {
                          html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(9, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
                      }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 5 other locations - About 4 hrs to fix
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 97..106
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 107..116
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 117..126
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 127..136
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 137..146

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

                  if ($(this).attr("IsSmartWarning") !== undefined) {
                      issmartwarning = parseInt($(this).attr("IsSmartWarning"), 10);
                      if (!isNaN(issmartwarning) && (issmartwarning === 1)) {
                          html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(10, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
                      }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 5 other locations - About 4 hrs to fix
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 87..96
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 107..116
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 117..126
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 127..136
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 137..146

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

                  if ($(this).attr("IsDamaged") !== undefined) {
                      isdamaged = parseInt($(this).attr("IsDamaged"), 10);
                      if (!isNaN(isdamaged) && (isdamaged === 1)) {
                          html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(14, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
                      }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 5 other locations - About 4 hrs to fix
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 87..96
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 97..106
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 107..116
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 117..126
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 127..136

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

                  if ($(this).attr("IsSmartPastAdvisoryThresholds") !== undefined) {
                      issmartpastadvisorythresholds = parseInt($(this).attr("IsSmartPastAdvisoryThresholds"), 10);
                      if (!isNaN(issmartpastadvisorythresholds) && (issmartpastadvisorythresholds === 1)) {
                          html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(12, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
                      }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 5 other locations - About 4 hrs to fix
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 87..96
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 97..106
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 107..116
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 127..136
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 137..146

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

                  if ($(this).attr("IsSmartPastThresholds") !== undefined) {
                      issmartpastthresholds = parseInt($(this).attr("IsSmartPastThresholds"), 10);
                      if (!isNaN(issmartpastthresholds) && (issmartpastthresholds === 1)) {
                          html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(11, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
                      }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 5 other locations - About 4 hrs to fix
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 87..96
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 97..106
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 117..126
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 127..136
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 137..146

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

                  if ($(this).attr("IsSmartFailurePredicted") !== undefined) {
                      issmartfailurepredicted = parseInt($(this).attr("IsSmartFailurePredicted"), 10);
                      if (!isNaN(issmartfailurepredicted) && (issmartfailurepredicted === 1)) {
                          html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(13, "StableBit") + "</div></span></td><td><img src=\"./plugins/stablebit/gfx/on.gif\" alt=\"on\" title=\"\" style=\"width:18px;\" /></td></tr>\n";
                      }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 5 other locations - About 4 hrs to fix
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 87..96
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 97..106
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 107..116
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 117..126
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 137..146

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

      $(document).ready(function stablebit_buildpage() {
          $("#footer").before(buildBlock("StableBit", 1, true));
          $("#Plugin_StableBit").css("width", "451px");
      
          stablebit_request();
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 3 other locations - About 3 hrs to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 205..215
      phpsysinfo/plugins/ps/js/ps.js on lines 132..142
      phpsysinfo/plugins/snmppinfo/js/snmppinfo.js on lines 150..160

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

      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

          $("#Plugin_StableBitTable").jqTreeTable(tree, {
              openImg: "./gfx/treeTable/tv-collapsable.gif",
              shutImg: "./gfx/treeTable/tv-expandable.gif",
              leafImg: "./gfx/treeTable/tv-item.gif",
              lastOpenImg: "./gfx/treeTable/tv-collapsable-last.gif",
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 7 other locations - About 2 hrs to fix
      phpsysinfo/js/phpSysInfo/phpsysinfo.js on lines 933..947
      phpsysinfo/js/phpSysInfo/phpsysinfo.js on lines 1042..1056
      phpsysinfo/js/phpSysInfo/phpsysinfo.js on lines 1165..1179
      phpsysinfo/js/phpSysInfo/phpsysinfo.js on lines 1596..1610
      phpsysinfo/plugins/bat/js/bat.js on lines 165..179
      phpsysinfo/plugins/ps/js/ps.js on lines 93..107
      phpsysinfo/plugins/snmppinfo/js/snmppinfo.js on lines 110..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 82.

      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 (temperaturec !== undefined) {
                      html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(8, "StableBit") + "</div></span></td><td>" + formatTemp(temperaturec, xml) +"</td></tr>\n";
                      tree.push(index);
                  }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 1 other location - About 1 hr to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 143..146

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

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

                  if (firmware !== undefined) {
                      html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(5, "StableBit") + "</div></span></td><td>" + firmware +"</td></tr>\n";
                      tree.push(index);
                  }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 9 other locations - About 45 mins to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 77..80
      phpsysinfo/plugins/bat/js/bat.js on lines 81..84
      phpsysinfo/plugins/bat/js/bat.js on lines 85..88
      phpsysinfo/plugins/bat/js/bat.js on lines 119..122
      phpsysinfo/plugins/bat/js/bat.js on lines 139..142
      phpsysinfo/plugins/bat/js/bat.js on lines 147..150
      phpsysinfo/plugins/bat/js/bat.js on lines 151..154
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 63..66
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 78..81

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

                  if (powerstate !== undefined) {
                      html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(7, "StableBit") + "</div></span></td><td>" + powerstate +"</td></tr>\n";
                      tree.push(index);
                  }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 9 other locations - About 45 mins to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 77..80
      phpsysinfo/plugins/bat/js/bat.js on lines 81..84
      phpsysinfo/plugins/bat/js/bat.js on lines 85..88
      phpsysinfo/plugins/bat/js/bat.js on lines 119..122
      phpsysinfo/plugins/bat/js/bat.js on lines 139..142
      phpsysinfo/plugins/bat/js/bat.js on lines 147..150
      phpsysinfo/plugins/bat/js/bat.js on lines 151..154
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 63..66
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 68..71

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

                  if (serialnumber !== undefined) {
                      html += "      <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(4, "StableBit") + "</div></span></td><td>" + serialnumber +"</td></tr>\n";
                      tree.push(index);
                  }
      Severity: Major
      Found in phpsysinfo/plugins/stablebit/js/stablebit.js and 9 other locations - About 45 mins to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 77..80
      phpsysinfo/plugins/bat/js/bat.js on lines 81..84
      phpsysinfo/plugins/bat/js/bat.js on lines 85..88
      phpsysinfo/plugins/bat/js/bat.js on lines 119..122
      phpsysinfo/plugins/bat/js/bat.js on lines 139..142
      phpsysinfo/plugins/bat/js/bat.js on lines 147..150
      phpsysinfo/plugins/bat/js/bat.js on lines 151..154
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 68..71
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 78..81

      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

      There are no issues that match your filters.

      Category
      Status