XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/plugins/raid/js/raid_bootstrap.js

Summary

Maintainability
F
1 wk
Test Coverage

Function renderPlugin_raid has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
Open

function renderPlugin_raid(data) {

    function raid_buildaction(data) {
        var html = "", name = "", percent = 0;
        if (data !== undefined) {
Severity: Minor
Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 3 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

Function renderPlugin_raid has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderPlugin_raid(data) {

    function raid_buildaction(data) {
        var html = "", name = "", percent = 0;
        if (data !== undefined) {
Severity: Major
Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 5 hrs to fix

    Function raid_diskicon has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function raid_diskicon(data , id, itemid) {
            var info = "";
    
            info = data.Info;
            if (info === undefined) info = "";
    Severity: Minor
    Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                          if (raiditems[i].Action !== undefined) {
                              var buildedaction = raid_buildaction(raiditems[i].Action['@attributes']);
                              if (buildedaction) {
                                  html += "<tr><td>" + buildedaction + "</td></tr>";
                              }
      Severity: Major
      Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (raiditems[i]["@attributes"].Devs !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(9, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Devs) + "</td></tr>"; // Devices
        Severity: Major
        Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (raiditems[i]["@attributes"].Algorithm !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(14, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Algorithm + "</td></tr>";
          Severity: Major
          Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if (!isNaN(parseInt(raiditems[i]["@attributes"].Disks_Registered)) && !isNaN(parseInt(raiditems[i]["@attributes"].Disks_Active))) {
                                    html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(18, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Disks_Registered) + "/<wbr>" + parseInt(raiditems[i]["@attributes"].Disks_Active) + "</td></tr>";
                                }
            Severity: Major
            Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if (raiditems[i]["@attributes"].Controller !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(19, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Controller + "</td></tr>"; // Controller
              Severity: Major
              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (raiditems[i]["@attributes"].Bad_Blocks !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(26, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Bad_Blocks) + "</td></tr>"; // Bad_Blocks
                Severity: Major
                Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (raiditems[i]["@attributes"].Battery !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(20, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Battery + "</td></tr>"; // Battery Condition
                  Severity: Major
                  Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (raiditems[i]["@attributes"].Name !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(3, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Name + "</td></tr>"; // Name
                    Severity: Major
                    Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (!isNaN(parseInt(raiditems[i]["@attributes"].Size))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(6, 'raid')+"</span></td><td>" + formatBytes(parseInt(raiditems[i]["@attributes"].Size), data.Options["@attributes"].byteFormat) + "</td></tr>";// Size
                      Severity: Major
                      Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if (raiditems[i]["@attributes"].WritePolicy !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(24, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].WritePolicy + "</td></tr>"; // Write Policy
                        Severity: Major
                        Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (raiditems[i]["@attributes"].Level !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(5, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Level + "</td></tr>"; // RAID-Level
                          Severity: Major
                          Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if (!isNaN(parseInt(raiditems[i]["@attributes"].Spares))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(10, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Spares) + "</td></tr>"; // Spares
                            Severity: Major
                            Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (raiditems[i]["@attributes"].Supported !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(21, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Supported + "</td></tr>"; // Supported RAID-Types
                              Severity: Major
                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if (!isNaN(parseInt(raiditems[i]["@attributes"].Persistend_Superblock))) {
                                                        if (parseInt(raiditems[i]["@attributes"].Persistend_Superblock) == 1) {
                                                            html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(15, 'raid')+"</span></td><td>"+genlang(16, 'raid')+"</td></tr>";
                                                        } else {
                                                            html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(15, 'raid')+"</span></td><td>"+genlang(17, 'raid')+"</td></tr>";
                                Severity: Major
                                Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (raiditems[i]["@attributes"].Cache_Size !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(25, 'raid')+"</span></td><td>" + formatBytes(parseInt(raiditems[i]["@attributes"].Cache_Size), data.Options["@attributes"].byteFormat) + "</td></tr>"; // Cache_Size
                                  Severity: Major
                                  Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if (!isNaN(parseInt(raiditems[i]["@attributes"].Subsets))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(8, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Subsets) + "</td></tr>"; // Subsets
                                    Severity: Major
                                    Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (!isNaN(parseInt(raiditems[i]["@attributes"].Chunk_Size))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(13, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Chunk_Size) + "K</td></tr>";
                                      Severity: Major
                                      Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if (raiditems[i]["@attributes"].ReadPolicy !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(23, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].ReadPolicy + "</td></tr>"; // Read Policy
                                        Severity: Major
                                        Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              if (!isNaN(parseInt(raiditems[i]["@attributes"].Stride))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(7, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Stride) + "</td></tr>"; // Stride
                                          Severity: Major
                                          Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                for (var j = 0; j < diskitems.length ; j++) {
                                                                    raid_diskicon(diskitems[j]["@attributes"], k, j);
                                                                }
                                            Severity: Major
                                            Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 45 mins to fix

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

                                                      switch (data.Status) {
                                                      case "ok":
                                                          img = "harddriveok.png";
                                                          alt = "ok";
                                                          bcolor = "green";
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 1 other location - About 5 hrs to fix
                                              phpsysinfo/plugins/raid/js/raid.js on lines 134..166

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

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                                  if (!isNaN(parseInt(raiditems[i]["@attributes"].Stride))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(7, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Stride) + "</td></tr>"; // Stride
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 2 other locations - About 2 hrs to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 104..104
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 106..106

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

                                                                  if (!isNaN(parseInt(raiditems[i]["@attributes"].Subsets))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(8, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Subsets) + "</td></tr>"; // Subsets
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 2 other locations - About 2 hrs to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 103..103
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 106..106

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

                                                                  if (!isNaN(parseInt(raiditems[i]["@attributes"].Spares))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(10, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Spares) + "</td></tr>"; // Spares
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 2 other locations - About 2 hrs to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 103..103
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 104..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 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 (raiditems[i]["@attributes"].Devs !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(9, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Devs) + "</td></tr>"; // Devices
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 1 other location - About 2 hrs to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 126..126

                                              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 (raiditems[i]["@attributes"].Bad_Blocks !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(26, 'raid')+"</span></td><td>" + parseInt(raiditems[i]["@attributes"].Bad_Blocks) + "</td></tr>"; // Bad_Blocks
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 1 other location - About 2 hrs to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 105..105

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

                                                                  if (raiditems[i]["@attributes"].Level !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(5, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Level + "</td></tr>"; // RAID-Level
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 5 other locations - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 99..99
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 121..121
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 122..122
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 123..123
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 124..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 72.

                                              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 (raiditems[i]["@attributes"].Name !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(3, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Name + "</td></tr>"; // Name
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 5 other locations - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 101..101
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 121..121
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 122..122
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 123..123
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 124..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 72.

                                              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 (raiditems[i]["@attributes"].ReadPolicy !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(23, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].ReadPolicy + "</td></tr>"; // Read Policy
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 5 other locations - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 99..99
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 101..101
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 121..121
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 122..122
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 124..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 72.

                                              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 (raiditems[i]["@attributes"].WritePolicy !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(24, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].WritePolicy + "</td></tr>"; // Write Policy
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 5 other locations - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 99..99
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 101..101
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 121..121
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 122..122
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 123..123

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

                                              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 (raiditems[i]["@attributes"].Battery !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(20, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Battery + "</td></tr>"; // Battery Condition
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 5 other locations - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 99..99
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 101..101
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 122..122
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 123..123
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 124..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 72.

                                              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 (raiditems[i]["@attributes"].Supported !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(21, 'raid')+"</span></td><td>" + raiditems[i]["@attributes"].Supported + "</td></tr>"; // Supported RAID-Types
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 5 other locations - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 99..99
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 101..101
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 121..121
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 123..123
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 124..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 72.

                                              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 (raiditems[i]["@attributes"].Cache_Size !== undefined) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(25, 'raid')+"</span></td><td>" + formatBytes(parseInt(raiditems[i]["@attributes"].Cache_Size), data.Options["@attributes"].byteFormat) + "</td></tr>"; // Cache_Size
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 1 other location - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 102..102

                                              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

                                                                  if (!isNaN(parseInt(raiditems[i]["@attributes"].Size))) html += "<tr class=\"treegrid-parent-raid-" + i + "\"><td><span class=\"treegrid-spanbold\">"+genlang(6, 'raid')+"</span></td><td>" + formatBytes(parseInt(raiditems[i]["@attributes"].Size), data.Options["@attributes"].byteFormat) + "</td></tr>";// Size
                                              Severity: Major
                                              Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js and 1 other location - About 1 hr to fix
                                              phpsysinfo/plugins/raid/js/raid_bootstrap.js on lines 125..125

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 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

                                              There are no issues that match your filters.

                                              Category
                                              Status