mrcnpdlk/validator

View on GitHub

Showing 54 of 54 total issues

Missing class import via use statement (line '48', column '27').
Open

                throw new \Exception(sprintf('Filter error!'));
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/IPv4.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '68', column '27').
Open

                throw new \Exception("Bank department checksum Error", 1);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Nrb.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '44', column '27').
Open

                throw new \Exception("Regexp error", 1);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Pna.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '51', column '27').
Open

                throw new \Exception("Checksum Error", 1);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Nip.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '61', column '27').
Open

                throw new \Exception("Checksum Error", 1);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Nrb.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '82', column '27').
Open

                throw new \Exception(sprintf('invalid length'));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '39', column '31').
Open

                    throw new \Exception("Checksum Error", 1);

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '42', column '27').
Open

                throw new \Exception("Regexp error", 1);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Mac.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '43', column '27').
Open

                throw new \Exception("Checksum Error", 1);

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '57', column '27').
Open

                throw new \Exception(sprintf('Parsed value is not a string, [%s] given', gettype($value)));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '118', column '20').
Open

        return new \DateTime(implode('-', [$year, $month, $inDay]));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '128', column '55').
Open

        $interval = $this->parseBirthDate()->diff(new \DateTime("now"));

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '45', column '23').
Open

            throw new \Exception(sprintf("Regexp error"), 1);

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '56', column '27').
Open

                throw new \Exception(sprintf('Parsed value is not a string, [%s] given', gettype($value)));
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Date.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '44', column '27').
Open

                throw new \Exception(sprintf('Invalid input argument type [%s]', gettype($checkedValue)));
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/IPv4.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '42', column '27').
Open

                throw new \Exception("Regexp error", 1);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Krs.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Function getUkeMobilePlan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getUkeMobilePlan()
    {
        if (empty($this->ukeMobilePlan)) {
            $oXml = new \SimpleXMLElement(file_get_contents(__DIR__ . '/../Databases/T2-PLMN_T9-MVNO.xml'));

Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Phone.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isValid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isValid($checkedValue, bool $asEx = false): bool
    {
        try {
            static::isValidType($checkedValue, static::TYPE_STRING, true);

Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Pna.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isValid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isValid($checkedValue, bool $asEx = false): bool
    {
        try {
            static::isValidType($checkedValue, static::TYPE_STRING, true);
            if (!preg_match('/^[A-NPR-Z]{3}[0-9]{6}$/', $checkedValue)) {
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/IDCard.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function parseBirthDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseBirthDate()
    {
        $inYear  = intval($this->checkedValue [0] . $this->checkedValue [1]);
        $inMonth = intval($this->checkedValue [2] . $this->checkedValue [3]);
        $inDay   = intval($this->checkedValue [4] . $this->checkedValue [5]);
Severity: Minor
Found in src/mrcnpdlk/Validator/Types/Pesel.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language