librenms/librenms

View on GitHub
LibreNMS/Alert/Transport/Discord.php

Summary

Maintainability
A
1 hr
Test Coverage

Method contactDiscord has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function contactDiscord($obj, $discord_opts)
    {
        $host = $discord_opts['url'];
        $curl = curl_init();
        $discord_title = '#' . $obj['uid'] . ' ' . $obj['title'];
Severity: Minor
Found in LibreNMS/Alert/Transport/Discord.php - About 1 hr to fix

    Avoid unused parameters such as '$opts'.
    Open

        public function deliverAlert($obj, $opts)
    Severity: Minor
    Found in LibreNMS/Alert/Transport/Discord.php by phpmd

    Since: PHPMD 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example:

    class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

    Source: http://phpmd.org/rules/unusedcode.txt

    Avoid unused parameters such as '$discord_opts'.
    Open

        public function createDiscordFields($obj, $discord_opts)
    Severity: Minor
    Found in LibreNMS/Alert/Transport/Discord.php by phpmd

    Since: PHPMD 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example:

    class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

    Source: http://phpmd.org/rules/unusedcode.txt

    FIXME found
    Open

                var_dump("API '$host' returned Error"); //FIXME: propper debuging
    Severity: Minor
    Found in LibreNMS/Alert/Transport/Discord.php by fixme

    FIXME found
    Open

                var_dump('Params: ' . $alert_message); //FIXME: propper debuging
    Severity: Minor
    Found in LibreNMS/Alert/Transport/Discord.php by fixme

    FIXME found
    Open

                var_dump('Return: ' . $ret); //FIXME: propper debuging
    Severity: Minor
    Found in LibreNMS/Alert/Transport/Discord.php by fixme

    There are no issues that match your filters.

    Category
    Status