keboola/php-datatypes

View on GitHub
src/Definition/Common.php

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 7 of 7 total issues

Function validateNumericLength has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

protected function validateNumericLength(
$length,
int $firstMax,
int $secondMax,
bool $firstMustBeBigger = true
Severity: Minor
Found in src/Definition/Common.php - About 55 mins to fix

Avoid too many return statements within this method.
Open

return false;
Severity: Major
Found in src/Definition/Common.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

    return !($firstMustBeBigger && isset($parts[1]) && (int) $parts[1] > (int) $parts[0]);
    Severity: Major
    Found in src/Definition/Common.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

      return false;
      Severity: Major
      Found in src/Definition/Common.php - About 30 mins to fix

        The method validateNumericLength() has an NPath complexity of 432. The configured NPath complexity threshold is 200.
        Open

        protected function validateNumericLength(
        $length,
        int $firstMax,
        int $secondMax,
        bool $firstMustBeBigger = true
        Severity: Minor
        Found in src/Definition/Common.php by phpmd

        The method validateNumericLength() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
        Open

        protected function validateNumericLength(
        $length,
        int $firstMax,
        int $secondMax,
        bool $firstMustBeBigger = true
        Severity: Minor
        Found in src/Definition/Common.php by phpmd

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

        bool $firstMustBeBigger = true
        Severity: Minor
        Found in src/Definition/Common.php by phpmd

        There are no issues that match your filters.

        Category
        Status