jon48/webtrees-lib

View on GitHub
app/Common/Tasks/TaskSchedule.php

Summary

Maintainability
A
1 hr
Test Coverage

The class TaskSchedule has 13 public methods. Consider refactoring TaskSchedule to keep number of public methods under 10.
Open

class TaskSchedule
{
    private int $id;
    private bool $enabled;
    private string $task_id;
Severity: Minor
Found in app/Common/Tasks/TaskSchedule.php by phpmd

TooManyPublicMethods

Since: 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'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

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

        int $id,
        string $task_id,
        bool $enabled,
        CarbonInterface $last_run,
        bool $last_result,
Severity: Major
Found in app/Common/Tasks/TaskSchedule.php - About 1 hr to fix

    Avoid using short method names like TaskSchedule::id(). The configured minimum method name length is 3.
    Open

        public function id(): int
        {
            return $this->id;
        }
    Severity: Minor
    Found in app/Common/Tasks/TaskSchedule.php by phpmd

    ShortMethodName

    Since: 0.2

    Detects when very short method names are used.

    Example

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

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

    Avoid variables with short names like $id. Configured minimum length is 3.
    Open

        private int $id;
    Severity: Minor
    Found in app/Common/Tasks/TaskSchedule.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $id. Configured minimum length is 3.
    Open

            int $id,
    Severity: Minor
    Found in app/Common/Tasks/TaskSchedule.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    There are no issues that match your filters.

    Category
    Status