renoki-co/php-k8s

View on GitHub

Showing 194 of 198 total issues

Avoid too many return statements within this method.
Open

        return $this;
Severity: Major
Found in src/Traits/Resource/HasAttributes.php - About 30 mins to fix

    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 getMountedVolumes has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getMountedVolumes(bool $asInstance = true)
    Severity: Minor
    Found in src/Instances/Container.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 getSchedule has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getSchedule(bool $asInstance = true)
    Severity: Minor
    Found in src/Kinds/K8sCronJob.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

    Remove error control operator '@' on line 236.
    Open

        protected function watchPath(string $path, Closure $callback, array $query = ['pretty' => 1])
        {
            $resourceClass = $this->resourceClass;
            $sock = $this->createSocketConnection($this->getCallableUrl($path, $query));
            $data = null;
    Severity: Minor
    Found in src/KubernetesCluster.php by phpmd

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

    Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

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

        public function getReadinessProbe(bool $asInstance = true)
    Severity: Minor
    Found in src/Instances/Container.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 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

    Remove error control operator '@' on line 60.
    Open

        public static function fromKubeConfigVariable(string $context = null)
        {
            /** @var \RenokiCo\PhpK8s\KubernetesCluster $this */
            $cluster = new static;
    
    

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

    Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

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

        public function getTemplate(bool $asInstance = true)
    Severity: Minor
    Found in src/Traits/Resource/HasTemplate.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 getApiPathPrefix has a boolean flag argument $withNamespace, which is a certain sign of a Single Responsibility Principle violation.
    Open

        protected function getApiPathPrefix(bool $withNamespace = true, string $preNamespaceAction = null): string
    Severity: Minor
    Found in src/Traits/RunsClusterOperations.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 getLivenessProbe has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getLivenessProbe(bool $asInstance = true)
    Severity: Minor
    Found in src/Instances/Container.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 getSubjects has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getSubjects(bool $asInstance = true): array
    Severity: Minor
    Found in src/Traits/Resource/HasSubjects.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

    Remove error control operator '@' on line 45.
    Open

        protected function loadClusterVersion(): void
        {
            if ($this->kubernetesVersion) {
                return;
            }

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

    Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

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

        public function allResourcesPath(bool $withNamespace = true): string;

    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 getStartupProbe has a boolean flag argument $asInstance, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getStartupProbe(bool $asInstance = true)
    Severity: Minor
    Found in src/Instances/Container.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 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

    Severity
    Category
    Status
    Source
    Language