librenms/librenms

View on GitHub
includes/polling/applications/cape.inc.php

Summary

Maintainability
F
2 wks
Test Coverage

File cape.inc.php has 943 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use LibreNMS\Exceptions\JsonAppException;
use LibreNMS\RRD\RrdDefinition;

Severity: Major
Found in includes/polling/applications/cape.inc.php - About 2 days to fix

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

        $fields = [
            'signatures_total' => $returned['pkg_stats'][$pkg]['signatures_total'],
            's0signatures_total' => $returned['pkg_stats'][$pkg]['min.signatures_total'],
            's1signatures_total' => $returned['pkg_stats'][$pkg]['max.signatures_total'],
            's2signatures_total' => $returned['pkg_stats'][$pkg]['range.signatures_total'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'anti_issues' => $returned['pkg_stats'][$pkg]['anti_issues'],
            's0anti_issues' => $returned['pkg_stats'][$pkg]['min.anti_issues'],
            's1anti_issues' => $returned['pkg_stats'][$pkg]['max.anti_issues'],
            's2anti_issues' => $returned['pkg_stats'][$pkg]['range.anti_issues'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'signatures_alert' => $returned['pkg_stats'][$pkg]['signatures_alert'],
            's0signatures_alert' => $returned['pkg_stats'][$pkg]['min.signatures_alert'],
            's1signatures_alert' => $returned['pkg_stats'][$pkg]['max.signatures_alert'],
            's2signatures_alert' => $returned['pkg_stats'][$pkg]['range.signatures_alert'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'reg_keys_mod' => $returned['pkg_stats'][$pkg]['registry_keys_modified'],
            's0regkeysmod' => $returned['pkg_stats'][$pkg]['min.registry_keys_modified'],
            's1regkeysmod' => $returned['pkg_stats'][$pkg]['max.registry_keys_modified'],
            's2regkeysmod' => $returned['pkg_stats'][$pkg]['range.registry_keys_modified'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'domains' => $returned['pkg_stats'][$pkg]['domains'],
            's0domains' => $returned['pkg_stats'][$pkg]['min.domains'],
            's1domains' => $returned['pkg_stats'][$pkg]['max.domains'],
            's2domains' => $returned['pkg_stats'][$pkg]['range.domains'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'weight' => $returned['pkg_stats'][$pkg]['weight'],
            's0weight' => $returned['pkg_stats'][$pkg]['min.weight'],
            's1weight' => $returned['pkg_stats'][$pkg]['max.weight'],
            's2weight' => $returned['pkg_stats'][$pkg]['range.weight'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733

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

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

        $fields = [
            'running_processes' => $returned['pkg_stats'][$pkg]['running_processes'],
            's0running_processes' => $returned['pkg_stats'][$pkg]['min.running_processes'],
            's1running_processes' => $returned['pkg_stats'][$pkg]['max.running_processes'],
            's2running_processes' => $returned['pkg_stats'][$pkg]['range.running_processes'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'api_calls' => $returned['pkg_stats'][$pkg]['api_calls'],
            's0api_calls' => $returned['pkg_stats'][$pkg]['min.api_calls'],
            's1api_calls' => $returned['pkg_stats'][$pkg]['max.api_calls'],
            's2api_calls' => $returned['pkg_stats'][$pkg]['range.api_calls'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'dropped_files' => $returned['pkg_stats'][$pkg]['dropped_files'],
            's0dropped_files' => $returned['pkg_stats'][$pkg]['min.dropped_files'],
            's1dropped_files' => $returned['pkg_stats'][$pkg]['max.dropped_files'],
            's2dropped_files' => $returned['pkg_stats'][$pkg]['range.dropped_files'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'crash_issues' => $returned['pkg_stats'][$pkg]['crash_issues'],
            's0crash_issues' => $returned['pkg_stats'][$pkg]['min.crash_issues'],
            's1crash_issues' => $returned['pkg_stats'][$pkg]['max.crash_issues'],
            's2crash_issues' => $returned['pkg_stats'][$pkg]['range.crash_issues'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'files_written' => $returned['pkg_stats'][$pkg]['files_written'],
            's0files_written' => $returned['pkg_stats'][$pkg]['min.files_written'],
            's1files_written' => $returned['pkg_stats'][$pkg]['max.files_written'],
            's2files_written' => $returned['pkg_stats'][$pkg]['range.files_written'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'confidence' => $returned['pkg_stats'][$pkg]['confidence'],
            's0confidence' => $returned['pkg_stats'][$pkg]['min.confidence'],
            's1confidence' => $returned['pkg_stats'][$pkg]['max.confidence'],
            's2confidence' => $returned['pkg_stats'][$pkg]['range.confidence'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 704..716
    includes/polling/applications/cape.inc.php on lines 738..750

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

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

        $fields = [
            'malscore' => $returned['pkg_stats'][$pkg]['malscore'],
            's0malscore' => $returned['pkg_stats'][$pkg]['min.malscore'],
            's1malscore' => $returned['pkg_stats'][$pkg]['max.malscore'],
            's2malscore' => $returned['pkg_stats'][$pkg]['range.malscore'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 12 other locations - About 5 hrs to fix
    includes/polling/applications/cape.inc.php on lines 534..546
    includes/polling/applications/cape.inc.php on lines 551..563
    includes/polling/applications/cape.inc.php on lines 568..580
    includes/polling/applications/cape.inc.php on lines 585..597
    includes/polling/applications/cape.inc.php on lines 602..614
    includes/polling/applications/cape.inc.php on lines 619..631
    includes/polling/applications/cape.inc.php on lines 636..648
    includes/polling/applications/cape.inc.php on lines 653..665
    includes/polling/applications/cape.inc.php on lines 670..682
    includes/polling/applications/cape.inc.php on lines 687..699
    includes/polling/applications/cape.inc.php on lines 721..733
    includes/polling/applications/cape.inc.php on lines 738..750

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

    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

    $fields = [
        'banned' => $returned['banned'],
        'completed' => $returned['completed'],
        'critical' => $returned['critical'],
        'debug' => $returned['debug'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 1 other location - About 4 hrs to fix
    includes/polling/applications/unbound.inc.php on lines 42..61

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

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

    $rrd_def_signatures_alert = RrdDefinition::make()
        ->addDataset('signatures_alert', 'GAUGE', 0)
        ->addDataset('s0signatures_alert', 'GAUGE', 0)
        ->addDataset('s1signatures_alert', 'GAUGE', 0)
        ->addDataset('s2signatures_alert', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_anti_issues = RrdDefinition::make()
        ->addDataset('anti_issues', 'GAUGE', 0)
        ->addDataset('s0anti_issues', 'GAUGE', 0)
        ->addDataset('s1anti_issues', 'GAUGE', 0)
        ->addDataset('s2anti_issues', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_malscore = RrdDefinition::make()
        ->addDataset('malscore', 'GAUGE', 0)
        ->addDataset('s0malscore', 'GAUGE', 0)
        ->addDataset('s1malscore', 'GAUGE', 0)
        ->addDataset('s2malscore', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_confidence = RrdDefinition::make()
        ->addDataset('confidence', 'GAUGE', 0)
        ->addDataset('s0confidence', 'GAUGE', 0)
        ->addDataset('s1confidence', 'GAUGE', 0)
        ->addDataset('s2confidence', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_weight = RrdDefinition::make()
        ->addDataset('weight', 'GAUGE', 0)
        ->addDataset('s0weight', 'GAUGE', 0)
        ->addDataset('s1weight', 'GAUGE', 0)
        ->addDataset('s2weight', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_dropped_files = RrdDefinition::make()
        ->addDataset('dropped_files', 'GAUGE', 0)
        ->addDataset('s0dropped_files', 'GAUGE', 0)
        ->addDataset('s1dropped_files', 'GAUGE', 0)
        ->addDataset('s2dropped_files', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_signatures_total = RrdDefinition::make()
        ->addDataset('signatures_total', 'GAUGE', 0)
        ->addDataset('s0signatures_total', 'GAUGE', 0)
        ->addDataset('s1signatures_total', 'GAUGE', 0)
        ->addDataset('s2signatures_total', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_api_calls = RrdDefinition::make()
        ->addDataset('api_calls', 'GAUGE', 0)
        ->addDataset('s0api_calls', 'GAUGE', 0)
        ->addDataset('s1api_calls', 'GAUGE', 0)
        ->addDataset('s2api_calls', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_severity = RrdDefinition::make()
        ->addDataset('severity', 'GAUGE', 0)
        ->addDataset('s0severity', 'GAUGE', 0)
        ->addDataset('s1severity', 'GAUGE', 0)
        ->addDataset('s2severity', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_crash_issues = RrdDefinition::make()
        ->addDataset('crash_issues', 'GAUGE', 0)
        ->addDataset('s0crash_issues', 'GAUGE', 0)
        ->addDataset('s1crash_issues', 'GAUGE', 0)
        ->addDataset('s2crash_issues', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_domains = RrdDefinition::make()
        ->addDataset('domains', 'GAUGE', 0)
        ->addDataset('s0domains', 'GAUGE', 0)
        ->addDataset('s1domains', 'GAUGE', 0)
        ->addDataset('s2domains', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_reg_keys_mod = RrdDefinition::make()
        ->addDataset('reg_keys_mod', 'GAUGE', 0)
        ->addDataset('s0regkeysmod', 'GAUGE', 0)
        ->addDataset('s1regkeysmod', 'GAUGE', 0)
        ->addDataset('s2regkeysmod', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_running_processes = RrdDefinition::make()
        ->addDataset('running_processes', 'GAUGE', 0)
        ->addDataset('s0running_processes', 'GAUGE', 0)
        ->addDataset('s1running_processes', 'GAUGE', 0)
        ->addDataset('s2running_processes', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 344..355
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_files_written = RrdDefinition::make()
       ->addDataset('files_written', 'GAUGE', 0)
        ->addDataset('s0files_written', 'GAUGE', 0)
        ->addDataset('s1files_written', 'GAUGE', 0)
        ->addDataset('s2files_written', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 18 other locations - About 3 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 463..474
    includes/polling/applications/cape.inc.php on lines 65..76
    includes/polling/applications/cape.inc.php on lines 96..107
    includes/polling/applications/cape.inc.php on lines 127..138
    includes/polling/applications/cape.inc.php on lines 158..169
    includes/polling/applications/cape.inc.php on lines 189..200
    includes/polling/applications/cape.inc.php on lines 220..231
    includes/polling/applications/cape.inc.php on lines 251..262
    includes/polling/applications/cape.inc.php on lines 282..293
    includes/polling/applications/cape.inc.php on lines 313..324
    includes/polling/applications/cape.inc.php on lines 375..386
    includes/polling/applications/cape.inc.php on lines 406..417
    includes/polling/applications/cape.inc.php on lines 437..448
    includes/polling/applications/cape.inc.php on lines 468..479
    includes/polling/applications/hv-monitor.inc.php on lines 246..257
    includes/polling/applications/opensearch.inc.php on lines 225..236
    includes/polling/applications/pi-hole.inc.php on lines 28..39
    includes/polling/applications/sdfsinfo.inc.php on lines 33..44

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

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

    $rrd_def_pkg = RrdDefinition::make()
            ->addDataset('tasks', 'GAUGE', 0)
            ->addDataset('pending', 'GAUGE', 0)
            ->addDataset('banned', 'GAUGE', 0)
            ->addDataset('running', 'GAUGE', 0)
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 3 other locations - About 2 hrs to fix
    LibreNMS/OS/Shared/Cisco.php on lines 508..518
    includes/polling/applications/bind.inc.php on lines 34..44
    includes/polling/applications/mojo_cape_submit.inc.php on lines 23..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 131.

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

    $fields = [
        'dropped_files' => $returned['dropped_files'],
        's0dropped_files' => $returned['min.dropped_files'],
        's1dropped_files' => $returned['max.dropped_files'],
        's2dropped_files' => $returned['range.dropped_files'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'signatures_alert' => $returned['signatures_alert'],
        's0signatures_alert' => $returned['min.signatures_alert'],
        's1signatures_alert' => $returned['max.signatures_alert'],
        's2signatures_alert' => $returned['range.signatures_alert'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields_signatures_total = [
        'signatures_total' => $returned['signatures_total'],
        's0signatures_total' => $returned['min.signatures_total'],
        's1signatures_total' => $returned['max.signatures_total'],
        's2signatures_total' => $returned['range.signatures_total'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'reg_keys_mod' => $returned['registry_keys_modified'],
        's0regkeysmod' => $returned['min.registry_keys_modified'],
        's1regkeysmod' => $returned['max.registry_keys_modified'],
        's2regkeysmod' => $returned['range.registry_keys_modified'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'severity' => $returned['severity'],
        's0severity' => $returned['min.severity'],
        's1severity' => $returned['max.severity'],
        's2severity' => $returned['range.severity'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields_running_processes = [
        'running_processes' => $returned['running_processes'],
        's0running_processes' => $returned['min.running_processes'],
        's1running_processes' => $returned['max.running_processes'],
        's2running_processes' => $returned['range.running_processes'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields_api_calls = [
        'api_calls' => $returned['api_calls'],
        's0api_calls' => $returned['min.api_calls'],
        's1api_calls' => $returned['max.api_calls'],
        's2api_calls' => $returned['range.api_calls'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'malscore' => $returned['malscore'],
        's0malscore' => $returned['min.malscore'],
        's1malscore' => $returned['max.malscore'],
        's2malscore' => $returned['range.malscore'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'crash_issues' => $returned['crash_issues'],
        's0crash_issues' => $returned['min.crash_issues'],
        's1crash_issues' => $returned['max.crash_issues'],
        's2crash_issues' => $returned['range.crash_issues'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'weight' => $returned['weight'],
        's0weight' => $returned['min.weight'],
        's1weight' => $returned['max.weight'],
        's2weight' => $returned['range.weight'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'files_written' => $returned['files_written'],
        's0files_written' => $returned['min.files_written'],
        's1files_written' => $returned['max.files_written'],
        's2files_written' => $returned['range.files_written'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields_domains = [
        'domains' => $returned['domains'],
        's0domains' => $returned['min.domains'],
        's1domains' => $returned['max.domains'],
        's2domains' => $returned['range.domains'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'confidence' => $returned['confidence'],
        's0confidence' => $returned['min.confidence'],
        's1confidence' => $returned['max.confidence'],
        's2confidence' => $returned['range.confidence'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 325..337
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

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

    $fields = [
        'anti_issues' => $returned['anti_issues'],
        's0anti_issues' => $returned['min.anti_issues'],
        's1anti_issues' => $returned['max.anti_issues'],
        's2anti_issues' => $returned['range.anti_issues'],
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 16 other locations - About 1 hr to fix
    includes/polling/applications/cape.inc.php on lines 77..89
    includes/polling/applications/cape.inc.php on lines 108..120
    includes/polling/applications/cape.inc.php on lines 139..151
    includes/polling/applications/cape.inc.php on lines 170..182
    includes/polling/applications/cape.inc.php on lines 201..213
    includes/polling/applications/cape.inc.php on lines 232..244
    includes/polling/applications/cape.inc.php on lines 263..275
    includes/polling/applications/cape.inc.php on lines 294..306
    includes/polling/applications/cape.inc.php on lines 356..368
    includes/polling/applications/cape.inc.php on lines 387..399
    includes/polling/applications/cape.inc.php on lines 418..430
    includes/polling/applications/cape.inc.php on lines 449..461
    includes/polling/applications/cape.inc.php on lines 480..492
    includes/polling/applications/drbd.inc.php on lines 28..40
    includes/polling/applications/hv-monitor.inc.php on lines 265..277
    includes/polling/applications/opensearch.inc.php on lines 237..249

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

    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

    try {
        $returned = json_app_get($device, $name, 1)['data'];
    } catch (JsonAppException $e) {
        echo PHP_EOL . $name . ':' . $e->getCode() . ':' . $e->getMessage() . PHP_EOL;
        update_application($app, $e->getCode() . ':' . $e->getMessage(), []); // Set empty metrics and error message
    Severity: Major
    Found in includes/polling/applications/cape.inc.php and 1 other location - About 1 hr to fix
    includes/polling/applications/chronyd.inc.php on lines 7..14

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

    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