rhosocial/yii2-base-models

View on GitHub

Showing 293 of 293 total issues

Blank lines are not allowed in a multi-line function declaration
Open


Scope keyword "static" must be followed by a single space
Open

    public function guid(mixed $guid, false|string $like = false): static
Severity: Minor
Found in traits/EntityQueryTrait.php by phpcodesniffer

Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Open

         */

Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Open

         */

Scope keyword "static" must be followed by a single space
Open

    public function byIdentity(?BaseUserModel $identity = null): static

Scope keyword "static" must be followed by a single space
Open

    public static function findIdentityByGuid(mixed $guid): ?static
Severity: Minor
Found in traits/IdentityTrait.php by phpcodesniffer

Scope keyword "static" must be followed by a single space
Open

    public function unreceived(): static
Severity: Minor
Found in traits/MessageQueryTrait.php by phpcodesniffer

Scope keyword "static" must be followed by a single space
Open

    public function recipients($users = []): static
Severity: Minor
Found in traits/MutualQueryTrait.php by phpcodesniffer

Scope keyword "static" must be followed by a single space
Open

    public static function isValid(mixed $user): false|static
Severity: Minor
Found in traits/UserTrait.php by phpcodesniffer

The first parameter of a multi-line function declaration must be on the line after the opening bracket
Open

        public ?string $createdAtAttribute = 'created_at',

Scope keyword "static" must be followed by a single space
Open

    public function page(int|string|null $pageSize = 10, ?int $currentPage = 0): static
Severity: Minor
Found in traits/EntityQueryTrait.php by phpcodesniffer

Method name "GUIDTrait::composite_guid_strs" is not in camel caps format
Open

    public static function composite_guid_strs($guids): string
Severity: Minor
Found in traits/GUIDTrait.php by phpcodesniffer

Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Open

         * @var int Determine the format of timestamp.

Scope keyword "static" must be followed by a single space
Open

    public function parentGuid(mixed $guid): static

Scope keyword "static" must be followed by a single space
Open

    public function updatedBy($guid): static

Expected 1 blank line at end of file; 2 found
Open

}
Severity: Minor
Found in traits/IDTrait.php by phpcodesniffer

Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Open

         * Set this attribute to false if you do not want to record it and know whether the entity has been edited.

Blank lines are not allowed in a multi-line function declaration
Open


Multi-line function declaration not indented correctly; expected 8 spaces but found 0
Open

         * @var string|false This attribute determines when the current entity expires.

Function setIPAddress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setIPAddress(?string $ipAddress): int|string|null
    {
        if (!$ipAddress || !$this->enableIP) {
            return null;
        }
Severity: Minor
Found in traits/IPTrait.php - About 35 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