librenms/librenms

View on GitHub

Showing 1,967 of 31,793 total issues

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

<?php

$unit_text = 'ska_offers';
$descr = 'ska_offers';
$ds = 'ska_offers';
Severity: Major
Found in includes/html/graphs/application/privoxy_ska_offers.inc.php and 57 other locations - About 40 mins to fix
includes/html/graphs/application/fail2ban_banned.inc.php on lines 1..13
includes/html/graphs/application/privoxy_block_percent.inc.php on lines 1..13
includes/html/graphs/application/privoxy_blocks.inc.php on lines 1..13
includes/html/graphs/application/privoxy_bytes_to_client.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_failures.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_timeouts.inc.php on lines 1..13
includes/html/graphs/application/privoxy_crunches.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_new.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_reuse.inc.php on lines 1..13
includes/html/graphs/application/privoxy_fast_redirs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_imp_accounted.inc.php on lines 1..13
includes/html/graphs/application/privoxy_max_reqs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_nog_conns.inc.php on lines 1..13
includes/html/graphs/application/privoxy_out_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_connect.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_delete.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_get.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_head.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_options.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_patch.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_post.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_put.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_trace.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_1xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_200.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_301.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_302.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_303.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_403.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_404.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_451.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_500.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_502.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_503.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_504.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_reused_server_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_np_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_0.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_1.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_2.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_3.inc.php on lines 1..13

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

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

<?php

$unit_text = 'reused_server_cons';
$descr = 'reused_server_cons';
$ds = 'reused_server_cons';
includes/html/graphs/application/fail2ban_banned.inc.php on lines 1..13
includes/html/graphs/application/privoxy_block_percent.inc.php on lines 1..13
includes/html/graphs/application/privoxy_blocks.inc.php on lines 1..13
includes/html/graphs/application/privoxy_bytes_to_client.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_failures.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_timeouts.inc.php on lines 1..13
includes/html/graphs/application/privoxy_crunches.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_new.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_reuse.inc.php on lines 1..13
includes/html/graphs/application/privoxy_fast_redirs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_imp_accounted.inc.php on lines 1..13
includes/html/graphs/application/privoxy_max_reqs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_nog_conns.inc.php on lines 1..13
includes/html/graphs/application/privoxy_out_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_connect.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_delete.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_get.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_head.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_options.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_patch.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_post.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_put.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_trace.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_1xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_200.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_301.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_302.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_303.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_403.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_404.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_451.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_500.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_502.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_503.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_504.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ska_offers.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_np_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_0.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_1.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_2.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_3.inc.php on lines 1..13

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

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

<?php

$unit_text = 'req_connect';
$descr = 'req_connect';
$ds = 'req_connect';
Severity: Major
Found in includes/html/graphs/application/privoxy_req_connect.inc.php and 57 other locations - About 40 mins to fix
includes/html/graphs/application/fail2ban_banned.inc.php on lines 1..13
includes/html/graphs/application/privoxy_block_percent.inc.php on lines 1..13
includes/html/graphs/application/privoxy_blocks.inc.php on lines 1..13
includes/html/graphs/application/privoxy_bytes_to_client.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_failures.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_timeouts.inc.php on lines 1..13
includes/html/graphs/application/privoxy_crunches.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_new.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_reuse.inc.php on lines 1..13
includes/html/graphs/application/privoxy_fast_redirs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_imp_accounted.inc.php on lines 1..13
includes/html/graphs/application/privoxy_max_reqs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_nog_conns.inc.php on lines 1..13
includes/html/graphs/application/privoxy_out_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_delete.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_get.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_head.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_options.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_patch.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_post.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_put.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_trace.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_1xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_200.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_301.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_302.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_303.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_403.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_404.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_451.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_500.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_502.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_503.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_504.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_reused_server_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ska_offers.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_np_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_0.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_1.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_2.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_3.inc.php on lines 1..13

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

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

<?php

$unit_text = 'client_requests';
$descr = 'client_requests';
$ds = 'client_requests';
includes/html/graphs/application/fail2ban_banned.inc.php on lines 1..13
includes/html/graphs/application/privoxy_block_percent.inc.php on lines 1..13
includes/html/graphs/application/privoxy_blocks.inc.php on lines 1..13
includes/html/graphs/application/privoxy_bytes_to_client.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_failures.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_timeouts.inc.php on lines 1..13
includes/html/graphs/application/privoxy_crunches.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_new.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_reuse.inc.php on lines 1..13
includes/html/graphs/application/privoxy_fast_redirs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_imp_accounted.inc.php on lines 1..13
includes/html/graphs/application/privoxy_max_reqs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_nog_conns.inc.php on lines 1..13
includes/html/graphs/application/privoxy_out_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_connect.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_delete.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_get.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_head.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_options.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_patch.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_post.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_put.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_trace.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_1xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_200.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_301.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_302.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_303.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_403.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_404.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_451.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_500.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_502.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_503.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_504.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_reused_server_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ska_offers.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_np_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_0.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_1.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_2.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_3.inc.php on lines 1..13

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

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

<?php

$unit_text = 'ver_2';
$descr = 'ver_2';
$ds = 'ver_2';
Severity: Major
Found in includes/html/graphs/application/privoxy_ver_2.inc.php and 57 other locations - About 40 mins to fix
includes/html/graphs/application/fail2ban_banned.inc.php on lines 1..13
includes/html/graphs/application/privoxy_block_percent.inc.php on lines 1..13
includes/html/graphs/application/privoxy_blocks.inc.php on lines 1..13
includes/html/graphs/application/privoxy_bytes_to_client.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_client_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_failures.inc.php on lines 1..13
includes/html/graphs/application/privoxy_con_timeouts.inc.php on lines 1..13
includes/html/graphs/application/privoxy_crunches.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_new.inc.php on lines 1..13
includes/html/graphs/application/privoxy_empty_resps_reuse.inc.php on lines 1..13
includes/html/graphs/application/privoxy_fast_redirs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_imp_accounted.inc.php on lines 1..13
includes/html/graphs/application/privoxy_max_reqs.inc.php on lines 1..13
includes/html/graphs/application/privoxy_nog_conns.inc.php on lines 1..13
includes/html/graphs/application/privoxy_out_requests.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_connect.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_delete.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_get.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_head.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_options.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_patch.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_post.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_put.inc.php on lines 1..13
includes/html/graphs/application/privoxy_req_trace.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_1xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_200.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_2xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_301.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_302.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_303.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_3xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_403.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_404.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_451.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_4xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_500.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_502.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_503.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_504.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx.inc.php on lines 1..13
includes/html/graphs/application/privoxy_resp_5xx_other.inc.php on lines 1..13
includes/html/graphs/application/privoxy_reused_server_cons.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ska_offers.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_np_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ubd_per.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_bdomains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains.inc.php on lines 1..13
includes/html/graphs/application/privoxy_unique_domains_np.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_0.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_1_1.inc.php on lines 1..13
includes/html/graphs/application/privoxy_ver_3.inc.php on lines 1..13

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

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

foreach ($graph_options as $option => $text) {
    if (empty($vars['graph'])) {
        $vars['graph'] = $option;
    }
    echo $sep;
Severity: Major
Found in includes/html/pages/apps/ntp.inc.php and 5 other locations - About 40 mins to fix
includes/html/pages/apps/ntp.inc.php on lines 45..58
includes/html/pages/device/services.inc.php on lines 41..57
includes/html/pages/device/slas.inc.php on lines 80..94
includes/html/pages/services.inc.php on lines 53..71
includes/html/pages/services.inc.php on lines 80..98

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

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

                foreach ($status_options as $option => $text) {
                    if (empty($vars['state'])) {
                        $vars['state'] = $option;
                    }

Severity: Major
Found in includes/html/pages/services.inc.php and 5 other locations - About 40 mins to fix
includes/html/pages/apps/ntp.inc.php on lines 45..58
includes/html/pages/apps/ntp.inc.php on lines 63..77
includes/html/pages/device/services.inc.php on lines 41..57
includes/html/pages/device/slas.inc.php on lines 80..94
includes/html/pages/services.inc.php on lines 53..71

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

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

foreach ($view_options as $option => $text) {
    if (empty($vars['view'])) {
        $vars['view'] = $option;
    }
    echo $sep;
Severity: Major
Found in includes/html/pages/apps/ntp.inc.php and 5 other locations - About 40 mins to fix
includes/html/pages/apps/ntp.inc.php on lines 63..77
includes/html/pages/device/services.inc.php on lines 41..57
includes/html/pages/device/slas.inc.php on lines 80..94
includes/html/pages/services.inc.php on lines 53..71
includes/html/pages/services.inc.php on lines 80..98

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

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

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

    foreach (explode(',', $data['parent_ids']) as $hostname) {
        $hostname = trim($hostname);
        $parent_id = ctype_digit($hostname) ? $hostname : getidbyname($hostname);
        if (empty($parent_id)) {
            return api_error(400, 'Parent device IDs/Hostname does not exist: ' . $hostname);
Severity: Minor
Found in includes/html/api_functions.inc.php and 1 other location - About 40 mins to fix
includes/html/api_functions.inc.php on lines 3106..3113

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

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

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

                    if (preg_match('/:/', $peer['bgpPeerIdentifier'])) {
                        $tmp_peer = str_replace(':', '', $peer['bgpPeerIdentifier']);
                        $tmp_peer = preg_replace('/([\w\d]{2})/', '\1:', $tmp_peer);
                        $tmp_peer = rtrim($tmp_peer, ':');
                    } else {
Severity: Minor
Found in includes/polling/bgp-peers.inc.php and 1 other location - About 40 mins to fix
includes/polling/bgp-peers.inc.php on lines 666..672

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

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

                foreach ($menu_options as $option => $text) {
                    if (empty($vars['view'])) {
                        $vars['view'] = $option;
                    }

Severity: Major
Found in includes/html/pages/services.inc.php and 5 other locations - About 40 mins to fix
includes/html/pages/apps/ntp.inc.php on lines 45..58
includes/html/pages/apps/ntp.inc.php on lines 63..77
includes/html/pages/device/services.inc.php on lines 41..57
includes/html/pages/device/slas.inc.php on lines 80..94
includes/html/pages/services.inc.php on lines 80..98

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

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

foreach ($menu_options as $option => $text) {
    if (empty($vars['view'])) {
        $vars['view'] = $option;
    }

Severity: Major
Found in includes/html/pages/device/services.inc.php and 5 other locations - About 40 mins to fix
includes/html/pages/apps/ntp.inc.php on lines 45..58
includes/html/pages/apps/ntp.inc.php on lines 63..77
includes/html/pages/device/slas.inc.php on lines 80..94
includes/html/pages/services.inc.php on lines 53..71
includes/html/pages/services.inc.php on lines 80..98

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

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

    foreach ($status_options as $option => $text) {
        if (empty($vars['opstatus'])) {
            $vars['opstatus'] = $option;
        }
        echo $sep;
Severity: Major
Found in includes/html/pages/device/slas.inc.php and 5 other locations - About 40 mins to fix
includes/html/pages/apps/ntp.inc.php on lines 45..58
includes/html/pages/apps/ntp.inc.php on lines 63..77
includes/html/pages/device/services.inc.php on lines 41..57
includes/html/pages/services.inc.php on lines 53..71
includes/html/pages/services.inc.php on lines 80..98

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

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

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

        foreach (explode(',', $data['parent_ids']) as $hostname) {
            $hostname = trim($hostname);
            $parent_id = ctype_digit($hostname) ? $hostname : getidbyname($hostname);
            if (empty($parent_id)) {
                return api_error(400, 'Parent device IDs/Hostname does not exist: ' . $hostname);
Severity: Minor
Found in includes/html/api_functions.inc.php and 1 other location - About 40 mins to fix
includes/html/api_functions.inc.php on lines 3078..3085

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

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

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

                    if (preg_match('/:/', $peer['bgpPeerIdentifier'])) {
                        $tmp_peer = str_replace(':', '', $peer['bgpPeerIdentifier']);
                        $tmp_peer = preg_replace('/([\w\d]{2})/', '\1:', $tmp_peer);
                        $tmp_peer = rtrim($tmp_peer, ':');
                    } else {
Severity: Minor
Found in includes/polling/bgp-peers.inc.php and 1 other location - About 40 mins to fix
includes/polling/bgp-peers.inc.php on lines 647..653

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

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 (isset($entry['lcosLXStatusWLANStationEntryEffTxRate'])) {
                $sensors['tx-' . $bssid] = new WirelessSensor(
                    'rate',
                    $this->getDeviceId(),
                    '.1.3.6.1.4.1.2356.13.1.3.32.1.50.' . Mac::parse($bssid)->oid() . '.0',
Severity: Minor
Found in LibreNMS/OS/Lcoslx.php and 1 other location - About 40 mins to fix
LibreNMS/OS/Lcoslx.php on lines 245..256

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

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 (isset($entry['lcosLXStatusWLANStationEntryEffRxRate'])) {
                $sensors['rx-' . $bssid] = new WirelessSensor(
                    'rate',
                    $this->getDeviceId(),
                    '.1.3.6.1.4.1.2356.13.1.3.32.1.51.' . Mac::parse($bssid)->oid() . '.0',
Severity: Minor
Found in LibreNMS/OS/Lcoslx.php and 1 other location - About 40 mins to fix
LibreNMS/OS/Lcoslx.php on lines 233..244

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

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

<?php
/**
 * arris-c4.inc.php
 *
 * LibreNMS os sensor pre-cache module for Arris CMTS
Severity: Minor
Found in includes/discovery/sensors/pre-cache/arris-c4.inc.php and 1 other location - About 40 mins to fix
includes/discovery/sensors/pre-cache/arris-c3.inc.php on lines 1..33

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

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

<?php
/**
 * arris-c3.inc.php
 *
 * LibreNMS os sensor pre-cache module for Arris CMTS
Severity: Minor
Found in includes/discovery/sensors/pre-cache/arris-c3.inc.php and 1 other location - About 40 mins to fix
includes/discovery/sensors/pre-cache/arris-c4.inc.php on lines 1..33

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

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 (is_numeric($d1_tx)) {
    $descr = 'D1 Tx Power';
    $index = 'vSFPD1TxPower.0';
    discover_sensor(
        $valid['sensor'],
Severity: Minor
Found in includes/discovery/sensors/dbm/fs-nmu.inc.php and 1 other location - About 40 mins to fix
includes/discovery/sensors/dbm/fs-nmu.inc.php on lines 169..189

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

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

Severity
Category
Status
Source
Language