abrain/einsatzverwaltung

View on GitHub
src/Settings/Pages/Report.php

Summary

Maintainability
A
3 hrs
Test Coverage
F
0%

The class Report has 12 public methods. Consider refactoring Report to keep number of public methods under 10.
Open

class Report extends SubPage
{
    private $useReportTemplateOptions = array(
        'no' => array(
            'label' => 'Nicht verwenden (zeigt die klassische Einzelansicht)'
Severity: Minor
Found in src/Settings/Pages/Report.php by phpmd

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

    public function registerSettings()
    {
        register_setting(
            'einsatzvw_settings_report',
            'einsatzvw_einsatz_hideemptydetails',
Severity: Minor
Found in src/Settings/Pages/Report.php - About 2 hrs to fix

    Method addSettingsFields has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function addSettingsFields()
        {
            add_settings_field(
                'einsatzvw_einsatz_hideemptydetails',
                'Einsatzdetails',
    Severity: Minor
    Found in src/Settings/Pages/Report.php - About 1 hr to fix

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

          private $useReportTemplateOptions = array(
              'no' => array(
                  'label' => 'Nicht verwenden (zeigt die klassische Einzelansicht)'
              ),
              'singular' => array(
      Severity: Minor
      Found in src/Settings/Pages/Report.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

      There are no issues that match your filters.

      Category
      Status