renoki-co/php-k8s

View on GitHub
src/Kinds/K8sResource.php

Summary

Maintainability
A
0 mins
Test Coverage

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

class K8sResource implements Arrayable, Jsonable
{
    use HasAnnotations;
    use HasAttributes;
    use HasEvents;
Severity: Minor
Found in src/Kinds/K8sResource.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 static access to class '\Illuminate\Support\Str' in method 'getPlural'.
Open

        return strtolower(Str::plural(static::getKind()));
Severity: Minor
Found in src/Kinds/K8sResource.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\RenokiCo\PhpK8s\K8s' in method 'register'.
Open

        K8s::registerCrd(static::class, $name);
Severity: Minor
Found in src/Kinds/K8sResource.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Arr' in method 'toArray'.
Open

            Arr::set($attributes, 'metadata.namespace', $this->getNamespace());
Severity: Minor
Found in src/Kinds/K8sResource.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Line exceeds 120 characters; contains 128 characters
Open

    public function watchContainerLogsByName(string $name, string $container, Closure $callback, array $query = ['pretty' => 1])
Severity: Minor
Found in src/Kinds/K8sResource.php by phpcodesniffer

There are no issues that match your filters.

Category
Status