XoopsModules25x/xoopsinfo

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

Summary

Maintainability
F
5 days
Test Coverage

Function bat_buildTable has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

function bat_buildTable(xml) {
    var html = "", tree = [], closed = [], batcount = 0;

    $("#Plugin_BAT #Plugin_BATTable").remove();

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

function bat_buildTable(xml) {
    var html = "", tree = [], closed = [], batcount = 0;

    $("#Plugin_BAT #Plugin_BATTable").remove();

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

    Function bat_getdisks has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $("Plugins Plugin_Bat Bat", xml).each(function bat_getdisks(id) {
            var name = "", DesignCapacity = "", FullCapacity = "", Capacity = "", DesignVoltage = "",  BatteryType = "",RemainingCapacity = "", PresentVoltage = "", ChargingState = "", BatteryTemperature = "", BatteryCondition = "", CapacityUnit = "", CycleCount = "", DesignVoltageMax = "", Manufacturer = "", Model = "", SerialNumber = "";
            name = $(this).attr("Name");
            if (name === undefined) {
                name = "Battery"+(batcount++);
    Severity: Major
    Found in phpsysinfo/plugins/bat/js/bat.js - About 4 hrs to fix

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

      function bat_request() {
          $("#Reload_BATTable").attr("title", "reload");
          $.ajax({
              url: "xml.php?plugin=BAT",
              dataType: "xml",
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.js and 11 other locations - About 4 hrs to fix
      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/stablebit/js/stablebit.js on lines 179..196
      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 4 locations. Consider refactoring.
      Open

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

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

                      } else {            
                          html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(13, "BAT") + "</div></span></td><td>" + FullCapacity+' '+CapacityUnit +"</td><td>" + createBar(parseInt(DesignCapacity, 10) !== 0 ? round(parseInt(FullCapacity, 10) / parseInt(DesignCapacity, 10) * 100, 0) : 0) + "</td></tr>\n";
                          tree.push(index);
                      }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.js and 1 other location - About 3 hrs to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 113..116

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

      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 (RemainingCapacity !== undefined) {
                          html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(3, "BAT") + "</div></span></td><td>" + RemainingCapacity+' '+CapacityUnit +"</td><td>" + createBar(parseInt(FullCapacity, 10) !== 0 ? round(parseInt(RemainingCapacity, 10) / parseInt(FullCapacity, 10) * 100, 0) : 0) + "</td></tr>\n";
                          tree.push(index);
                      }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.js and 1 other location - About 3 hrs to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 109..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 100.

      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_BATTable").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/bat/js/bat.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/ps/js/ps.js on lines 93..107
      phpsysinfo/plugins/snmppinfo/js/snmppinfo.js on lines 110..124
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 158..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 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 (RemainingCapacity !== undefined) {
                          html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(3, "BAT") + "</div></span></td><td>" + RemainingCapacity+' '+CapacityUnit +"</td><td></td></tr>\n";
                          tree.push(index);
                      }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.js and 1 other location - About 1 hr to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 96..99

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

      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 (DesignCapacity !== undefined) {
                      html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(2, "BAT") + "</div></span></td><td>" + DesignCapacity+' '+CapacityUnit +"</td><td></td></tr>\n";
                      tree.push(index);
                  }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.js and 1 other location - About 1 hr to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 101..104

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

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

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

              } else if (DesignVoltageMax !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(4, "BAT") + "</div></span></td><td>" + DesignVoltageMax+' mV' +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Minor
      Found in phpsysinfo/plugins/bat/js/bat.js and 1 other location - About 55 mins to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 135..138

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

              if (PresentVoltage !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(5, "BAT") + "</div></span></td><td>" + PresentVoltage+' mV' +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Minor
      Found in phpsysinfo/plugins/bat/js/bat.js and 1 other location - About 55 mins to fix
      phpsysinfo/plugins/bat/js/bat.js on lines 131..134

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 54.

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

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

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

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

      Refactorings

      Further Reading

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

              if (SerialNumber !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(16, "BAT") + "</div></span></td><td>" + SerialNumber +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.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 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
      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 (Manufacturer !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(14, "BAT") + "</div></span></td><td>" + Manufacturer +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.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 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
      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 (BatteryType !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(9, "BAT") + "</div></span></td><td>" + BatteryType +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.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 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
      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 (ChargingState !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(8, "BAT") + "</div></span></td><td>" + ChargingState +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.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 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
      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 (BatteryCondition !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(11, "BAT") + "</div></span></td><td>" + BatteryCondition +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.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 151..154
      phpsysinfo/plugins/stablebit/js/stablebit.js on lines 63..66
      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

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

              if (CycleCount !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(12, "BAT") + "</div></span></td><td>" + CycleCount +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.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/stablebit/js/stablebit.js on lines 63..66
      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

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

              if (Model !== undefined) {
                  html += "     <tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(15, "BAT") + "</div></span></td><td>" + Model +"</td><td></td></tr>\n";
                  tree.push(index);
              }
      Severity: Major
      Found in phpsysinfo/plugins/bat/js/bat.js and 9 other locations - About 45 mins to fix
      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
      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