uruba/FinanCalc

View on GitHub
src/Calculators/DebtAmortizator.php

Summary

Maintainability
A
2 hrs
Test Coverage

DebtAmortizator has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

    class DebtAmortizator extends CalculatorAbstract
    {
        /** @var  RepaymentInstance[] */
        // list of individual debt's repayments as an array of RepaymentInstance objects
        protected $debtRepayments;
Severity: Minor
Found in src/Calculators/DebtAmortizator.php - About 2 hrs to fix

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

                $i = 1;
    Severity: Minor
    Found in src/Calculators/DebtAmortizator.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

    Each class must be in a file by itself
    Open

        class RepaymentInstance

    The closing brace for the class must go on the next line after the body
    Open

        }

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

            }

    Line indented incorrectly; expected at least 16 spaces, found 12
    Open

                "debtSingleRepayment",

    Line indented incorrectly; expected at least 16 spaces, found 12
    Open

                "debtRepayments" => "debtRepaymentsAsArrays"

    Line indented incorrectly; expected at least 16 spaces, found 12
    Open

                "debtLength" =>

    Line indented incorrectly; expected at least 16 spaces, found 12
    Open

                "debtInterest",

    Line indented incorrectly; expected at least 16 spaces, found 12
    Open

                "debtDiscountFactor",

    There are no issues that match your filters.

    Category
    Status