src/Settings/Pages/Report.php
The class Report has 12 public methods. Consider refactoring Report to keep number of public methods under 10. Open
Open
class Report extends SubPage
{
private $useReportTemplateOptions = array(
'no' => array(
'label' => 'Nicht verwenden (zeigt die klassische Einzelansicht)'
- Read upRead up
- Exclude checks
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 registerSettings
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function registerSettings()
{
register_setting(
'einsatzvw_settings_report',
'einsatzvw_einsatz_hideemptydetails',
Method addSettingsFields
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addSettingsFields()
{
add_settings_field(
'einsatzvw_einsatz_hideemptydetails',
'Einsatzdetails',
Avoid excessively long variable names like $useReportTemplateOptions. Keep variable name length under 20. Open
Open
private $useReportTemplateOptions = array(
'no' => array(
'label' => 'Nicht verwenden (zeigt die klassische Einzelansicht)'
),
'singular' => array(
- Read upRead up
- Exclude checks
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++ ) {
}
}
}