renoki-co/php-k8s

View on GitHub
src/Kinds/K8sSecret.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function getData(bool $decode = false)
Severity: Minor
Found in src/Kinds/K8sSecret.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 setData has a boolean flag argument $encode, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setData(array $data, bool $encode = true)
Severity: Minor
Found in src/Kinds/K8sSecret.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 addData has a boolean flag argument $encode, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function addData(string $name, $value, $encode = true)
Severity: Minor
Found in src/Kinds/K8sSecret.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 unused local variables such as '$key'.
Open

            foreach ($data as $key => &$value) {
Severity: Minor
Found in src/Kinds/K8sSecret.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$key'.
Open

            foreach ($data as $key => &$value) {
Severity: Minor
Found in src/Kinds/K8sSecret.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

There are no issues that match your filters.

Category
Status