XoopsModules25x/xoopsinfo

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

Summary

Maintainability
C
1 day
Test Coverage

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

function iptables_request() {
    $("#Reload_iptablesTable").attr("title", "reload");
    $.ajax({
        url: "xml.php?plugin=iptables",
        dataType: "xml",
Severity: Major
Found in phpsysinfo/plugins/iptables/js/iptables.js and 11 other locations - About 4 hrs to fix
phpsysinfo/plugins/bat/js/bat.js on lines 186..203
phpsysinfo/plugins/docker/js/docker.js on lines 118..135
phpsysinfo/plugins/hyperv/js/hyperv.js on lines 96..113
phpsysinfo/plugins/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 iptables_buildpage() {
    $("#footer").before(buildBlock("iptables", 1, true));
    $("#Plugin_iptables").css("width", "915px");

    iptables_buildTable();
Severity: Major
Found in phpsysinfo/plugins/iptables/js/iptables.js and 6 other locations - About 4 hrs to fix
phpsysinfo/plugins/docker/js/docker.js on lines 137..149
phpsysinfo/plugins/hyperv/js/hyperv.js on lines 115..127
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

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

function iptables_buildTable() {
    var html = "";

    html += "<div style=\"overflow-x:auto;\">\n";
    html += "  <table id=\"Plugin_iptablesTable\" class=\"stripeMe\" style=\"border-collapse:collapse;\">\n";
Severity: Major
Found in phpsysinfo/plugins/iptables/js/iptables.js and 1 other location - About 4 hrs to fix
phpsysinfo/plugins/updatenotifier/js/updatenotifier.js on lines 63..80

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

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