Kentico/delivery-sdk-php

View on GitHub
src/KenticoCloud/Delivery/QueryParams.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

The class QueryParams has 23 public methods. Consider refactoring QueryParams to keep number of public methods under 10.
Invalid

class QueryParams implements \ArrayAccess
{
    /**
     * Filter key-value pairs.
     *

Since: PHPMD 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects. By default it ignores methods starting with 'get' or 'set'.

Source: http://phpmd.org/rules/codesize.txt

QueryParams has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class QueryParams implements \ArrayAccess
{
    /**
     * Filter key-value pairs.
     *
Severity: Minor
Found in src/KenticoCloud/Delivery/QueryParams.php - About 2 hrs to fix

    Class "QueryParams" has 23 methods, which is greater than 20 authorized. Split it into smaller classes.
    Wontfix

    class QueryParams implements \ArrayAccess

    A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

    Avoid using short method names like QueryParams::in(). The configured minimum method name length is 3.
    Wontfix

        public function in($element, $values)
        {
            $this->data[$element.'[in]'] = implode(',', is_array($values) ? $values : array($values));
    
            return $this;

    Since: PHPMD 0.2

    Detects when very short method names are used.

    Example:

    class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

    Source: http://phpmd.org/rules/naming.txt

    There are no issues that match your filters.

    Category
    Status