rinvex/laravel-subscriptions

View on GitHub
src/Models/PlanSubscription.php

Summary

Maintainability
B
5 hrs
Test Coverage

The class PlanSubscription has an overall complexity of 52 which is very high. The configured complexity threshold is 50.
Open

class PlanSubscription extends Model
{
    use HasSlug;
    use HasFactory;
    use SoftDeletes;
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

PlanSubscription has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class PlanSubscription extends Model
{
    use HasSlug;
    use HasFactory;
    use SoftDeletes;
Severity: Minor
Found in src/Models/PlanSubscription.php - About 3 hrs to fix

File PlanSubscription.php has 256 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace Rinvex\Subscriptions\Models;
Severity: Minor
Found in src/Models/PlanSubscription.php - About 2 hrs to fix

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

    protected $throwValidationExceptions = true;
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

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

The parameter $invoice_period is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $invoice_interval is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The variable $invoice_interval is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $invoice_period is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $invoice_interval is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $invoice_period is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $invoice_interval is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $invoice_period is not named in camelCase.
Open

    protected function setNewPeriod($invoice_interval = '', $invoice_period = '', $start = '')
    {
        if (empty($invoice_interval)) {
            $invoice_interval = $this->plan->invoice_interval;
        }
Severity: Minor
Found in src/Models/PlanSubscription.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status