renoki-co/php-k8s

View on GitHub
src/Kinds/K8sPod.php

Summary

Maintainability
A
0 mins
Test Coverage

The class K8sPod has an overall complexity of 57 which is very high. The configured complexity threshold is 50.
Open

class K8sPod extends K8sResource implements
    Attachable,
    Dnsable,
    Executable,
    InteractsWithK8sCluster,
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

The method getInitContainer has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getInitContainer(string $containerName, bool $asInstance = true)
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getContainer has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getContainer(string $containerName, bool $asInstance = true)
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getInitContainers has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getInitContainers(bool $asInstance = true): array
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getVolumes has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getVolumes(bool $asInstance = true)
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getPodAffinity has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getPodAffinity(bool $asInstance = true)
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getContainerStatuses has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getContainerStatuses(bool $asInstance = true): array
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getNodeAffinity has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getNodeAffinity(bool $asInstance = true)
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getContainers has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getContainers(bool $asInstance = true): array
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

The method getInitContainerStatuses has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getInitContainerStatuses(bool $asInstance = true): array
Severity: Minor
Found in src/Kinds/K8sPod.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

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

                $container = K8s::container($container);
Severity: Minor
Found in src/Kinds/K8sPod.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 'getContainerStatuses'.
Open

                $container = K8s::container($container);
Severity: Minor
Found in src/Kinds/K8sPod.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

There are no issues that match your filters.

Category
Status