XoopsModules25x/tag

View on GitHub
class/Issues.php

Summary

Maintainability
A
1 hr
Test Coverage

getCachedEtag accesses the super-global variable $_SESSION.
Open

    public function getCachedEtag()
    {
        return isset($_SESSION[$this->getsKeyEtag()]) ? \base64_decode(\unserialize($_SESSION[$this->getsKeyEtag()]), true) : false;
    }
Severity: Minor
Found in class/Issues.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

execCurl accesses the super-global variable $_SESSION.
Open

    public function execCurl(): int
    {
        $curl = \curl_init($this->getServiceUrl());
        \curl_setopt_array(
            $curl,
Severity: Minor
Found in class/Issues.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getCachedEtag accesses the super-global variable $_SESSION.
Open

    public function getCachedEtag()
    {
        return isset($_SESSION[$this->getsKeyEtag()]) ? \base64_decode(\unserialize($_SESSION[$this->getsKeyEtag()]), true) : false;
    }
Severity: Minor
Found in class/Issues.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

execCurl accesses the super-global variable $_SESSION.
Open

    public function execCurl(): int
    {
        $curl = \curl_init($this->getServiceUrl());
        \curl_setopt_array(
            $curl,
Severity: Minor
Found in class/Issues.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

execCurl accesses the super-global variable $_SESSION.
Open

    public function execCurl(): int
    {
        $curl = \curl_init($this->getServiceUrl());
        \curl_setopt_array(
            $curl,
Severity: Minor
Found in class/Issues.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Method execCurl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execCurl(): int
    {
        $curl = \curl_init($this->getServiceUrl());
        \curl_setopt_array(
            $curl,
Severity: Minor
Found in class/Issues.php - About 1 hr to fix

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

        public function getCurlResponse(bool $serialized = false): string
    Severity: Minor
    Found in class/Issues.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 getHeaderFromArray has a boolean flag argument $asArray, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getHeaderFromArray(string $hdr, bool $asArray = false)
    Severity: Minor
    Found in class/Issues.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 parameters such as '$curl'.
    Open

        public function handleHeaderLine($curl, string $hdrLine): int
    Severity: Minor
    Found in class/Issues.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

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

    The property $curl_response is not named in camelCase.
    Open

    class Issues
    {
        /**
         * @var array
         */
    Severity: Minor
    Found in class/Issues.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

    Line exceeds 120 characters; contains 132 characters
    Open

            return isset($_SESSION[$this->getsKeyEtag()]) ? \base64_decode(\unserialize($_SESSION[$this->getsKeyEtag()]), true) : false;
    Severity: Minor
    Found in class/Issues.php by phpcodesniffer

    Line exceeds 120 characters; contains 163 characters
    Open

    //declare(strict_types=1); //mb do not use it here, as it generates conflict on line 280: base64_encode(): Argument #1 ($string) must be of type string, bool given
    Severity: Minor
    Found in class/Issues.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status