XoopsModules25x/xoopsinfo

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

Summary

Maintainability
C
1 day
Test Coverage

Function docker_buildTable has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function docker_buildTable() {
    var html = "";

    html += "<div style=\"overflow-x:auto;\">\n";
    html += "  <table id=\"Plugin_DockerTable\" class=\"stripeMe\" style=\"border-collapse:collapse;\">\n";
Severity: Major
Found in phpsysinfo/plugins/docker/js/docker.js - About 2 hrs to fix

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

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

    $(document).ready(function docker_buildpage() {
        $("#footer").before(buildBlock("Docker", 1, true));
        $("#Plugin_Docker").css("width", "915px");
    
        docker_buildTable();
    Severity: Major
    Found in phpsysinfo/plugins/docker/js/docker.js and 6 other locations - About 4 hrs to fix
    phpsysinfo/plugins/hyperv/js/hyperv.js on lines 115..127
    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