librenms/librenms

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

Summary

Maintainability
A
3 hrs
Test Coverage

Method configTemplate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function configTemplate()
    {
        return [
            'config' => [
                [
Severity: Minor
Found in LibreNMS/Alert/Transport/Matrix.php - About 1 hr to fix

    Method contactMatrix has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function contactMatrix($obj, $server, $room, $authtoken, $message)
        {
            $request_opts = [];
            $request_heads = [];
            $txnid = rand(1111, 9999) . time();
    Severity: Minor
    Found in LibreNMS/Alert/Transport/Matrix.php - About 1 hr to fix

      Method contactMatrix has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function contactMatrix($obj, $server, $room, $authtoken, $message)
      Severity: Minor
      Found in LibreNMS/Alert/Transport/Matrix.php - About 35 mins to fix

        Avoid unused parameters such as '$opts'.
        Open

            public function deliverAlert($obj, $opts)
        Severity: Minor
        Found in LibreNMS/Alert/Transport/Matrix.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

        There are no issues that match your filters.

        Category
        Status