librenms/librenms

View on GitHub
LibreNMS/Util/Git.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Git has 13 public methods. Consider refactoring Git to keep number of public methods under 10.
Open

class Git
{
    use RuntimeClassCache;

    /** @var string */
Severity: Minor
Found in LibreNMS/Util/Git.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Avoid using empty try-catch blocks in remoteCommit.
Open

                } catch (ConnectionException $e) {
                }
Severity: Minor
Found in LibreNMS/Util/Git.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

The property $install_dir is not named in camelCase.
Open

class Git
{
    use RuntimeClassCache;

    /** @var string */
Severity: Minor
Found in LibreNMS/Util/Git.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

There are no issues that match your filters.

Category
Status