rinvex/laravel-subscriptions

View on GitHub

Showing 17 of 17 total issues

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

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

    protected $throwValidationExceptions = true;
Severity: Minor
Found in src/Models/Plan.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

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

    protected $throwValidationExceptions = true;
Severity: Minor
Found in src/Models/PlanSubscriptionUsage.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

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

    protected $throwValidationExceptions = true;
Severity: Minor
Found in src/Models/PlanFeature.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

Method morphMany has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    abstract public function morphMany($related, $name, $type = null, $id = null, $localKey = null);
Severity: Minor
Found in src/Traits/HasPlanSubscriptions.php - About 35 mins to fix

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_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 $plan_feature is not named in camelCase.
Open

    protected static function boot()
    {
        parent::boot();

        static::deleted(function ($plan_feature) {
Severity: Minor
Found in src/Models/PlanFeature.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_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

Severity
Category
Status
Source
Language