XoopsModules25x/xoopsinfo

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

Summary

Maintainability
F
3 days
Test Coverage

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

function hyperv_buildTable() {
    var html = "";

    html += "<div style=\"overflow-x:auto;\">\n";
    html += "  <table id=\"Plugin_HyperVTable\" style=\"border-collapse:collapse;\">\n";
Severity: Minor
Found in phpsysinfo/plugins/hyperv/js/hyperv.js - About 1 hr to fix

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

    function hyperv_buildTable() {
        var html = "";
    
        html += "<div style=\"overflow-x:auto;\">\n";
        html += "  <table id=\"Plugin_HyperVTable\" style=\"border-collapse:collapse;\">\n";
    Severity: Major
    Found in phpsysinfo/plugins/hyperv/js/hyperv.js and 2 other locations - About 1 day to fix
    phpsysinfo/plugins/pingtest/js/pingtest.js on lines 57..90
    phpsysinfo/plugins/psstatus/js/psstatus.js on lines 58..91

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

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

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

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

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

    Refactorings

    Further Reading

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

    function hyperv_populate(xml) {
        var name = "", status = 0, state = "";
    
        hyperv_table.fnClearTable();
    
    
    Severity: Major
    Found in phpsysinfo/plugins/hyperv/js/hyperv.js and 1 other location - About 1 day to fix
    phpsysinfo/plugins/psstatus/js/psstatus.js on lines 36..53

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

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

    function hyperv_request() {
        $("#Reload_HyperVTable").attr("title", "reload");
        $.ajax({
            url: "xml.php?plugin=HyperV",
            dataType: "xml",
    Severity: Major
    Found in phpsysinfo/plugins/hyperv/js/hyperv.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/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 7 locations. Consider refactoring.
    Open

    $(document).ready(function hyperv_buildpage() {
        $("#footer").before(buildBlock("HyperV", 1, true));
        $("#Plugin_HyperV").css("width", "451px");
    
        hyperv_buildTable();
    Severity: Major
    Found in phpsysinfo/plugins/hyperv/js/hyperv.js and 6 other locations - About 4 hrs to fix
    phpsysinfo/plugins/docker/js/docker.js on lines 137..149
    phpsysinfo/plugins/iptables/js/iptables.js on lines 92..104
    phpsysinfo/plugins/pingtest/js/pingtest.js on lines 114..126
    phpsysinfo/plugins/psstatus/js/psstatus.js on lines 115..127
    phpsysinfo/plugins/quotas/js/quotas.js on lines 137..149
    phpsysinfo/plugins/uprecords/js/uprecords.js on lines 114..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 119.

    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