src/Calculators/DebtAmortizator.php
DebtAmortizator
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DebtAmortizator extends CalculatorAbstract
{
/** @var RepaymentInstance[] */
// list of individual debt's repayments as an array of RepaymentInstance objects
protected $debtRepayments;
Avoid variables with short names like $i. Configured minimum length is 3. Open
Open
$i = 1;
- Read upRead up
- Exclude checks
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
Open
class RepaymentInstance
- Exclude checks
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
"debtRepayments" => "debtRepaymentsAsArrays"
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
"debtSingleRepayment",
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
"debtInterest",
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
"debtDiscountFactor",
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
"debtLength" =>
- Exclude checks