jon48/webtrees-lib

View on GitHub
app/Module/IsSourced/Hooks/IsSourcedStatusHook.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function recordNameAppend(GedcomRecord $record, bool $use_long = false, string $size = ''): string

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

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

    public function recordNamePrepend(GedcomRecord $record, bool $use_long = false, string $size = ''): string

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid excessively long variable names like $source_status_service. Keep variable name length under 20.
Open

    private SourceStatusService $source_status_service;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $source_status_service. Keep variable name length under 20.
Open

    public function __construct(ModuleInterface $module, SourceStatusService $source_status_service)

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

There are no issues that match your filters.

Category
Status