netglue/prismic-php-kit

View on GitHub
src/Prismic/Form.php

Summary

Maintainability
A
1 hr
Test Coverage
A
91%

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ?string $name = null,
        string  $method,
        ?string $rel = null,
        string  $enctype,
        string  $action,
Severity: Minor
Found in src/Prismic/Form.php - About 45 mins to fix

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

        public function defaultData() : array
        {
            /**
             * @var string    $key
             * @var FieldForm $field
    Severity: Minor
    Found in src/Prismic/Form.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

    Doc-block of $name in __construct is phpdoc param type string which is not a permitted replacement of the nullable param type ?string declared in the signature ('?T' should be documented as 'T|null' or '?T')
    Open

         * @param string $name      the name of the form
    Severity: Minor
    Found in src/Prismic/Form.php by phan

    Doc-block of $rel in __construct is phpdoc param type string which is not a permitted replacement of the nullable param type ?string declared in the signature ('?T' should be documented as 'T|null' or '?T')
    Open

         * @param string $rel       the rel if there's one
    Severity: Minor
    Found in src/Prismic/Form.php by phan

    Required argument follows optional
    Open

        private function __construct(
    Severity: Info
    Found in src/Prismic/Form.php by phan

    There are no issues that match your filters.

    Category
    Status