Jelle-S/TheSportsDb

View on GitHub
src/Entity/Event.php

Summary

Maintainability
D
2 days
Test Coverage

Method initPropertyMapDefinition has 189 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  protected static function initPropertyMapDefinition() {
    static::$propertyMapDefinition
      ->addPropertyMap(
        new PropertyDefinition('idEvent'),
        new PropertyDefinition('id')
Severity: Major
Found in src/Entity/Event.php - About 7 hrs to fix

    Event has 51 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Event extends Entity implements EventInterface {
    
      /**
       * {@inheritdoc}
       */
    Severity: Major
    Found in src/Entity/Event.php - About 7 hrs to fix

      File Event.php has 395 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @file
       * Contains \TheSportsDb\Entity\Event.
       */
      Severity: Minor
      Found in src/Entity/Event.php - About 5 hrs to fix

        The class Event has an overall complexity of 53 which is very high. The configured complexity threshold is 50.
        Open

        class Event extends Entity implements EventInterface {
        
          /**
           * {@inheritdoc}
           */
        Severity: Minor
        Found in src/Entity/Event.php by phpmd

        The class Event has 50 public methods and attributes. Consider reducing the number of public items to less than 50.
        Open

        class Event extends Entity implements EventInterface {
        
          /**
           * {@inheritdoc}
           */
        Severity: Minor
        Found in src/Entity/Event.php by phpmd

        ExcessivePublicCount

        Since: 0.1

        A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

        Example

        public class Foo {
            public $value;
            public $something;
            public $var;
            // [... more more public attributes ...]
        
            public function doWork() {}
            public function doMoreWork() {}
            public function doWorkAgain() {}
            // [... more more public methods ...]
        }

        Source https://phpmd.org/rules/codesize.html#excessivepubliccount

        The method initPropertyMapDefinition() has 197 lines of code. Current threshold is set to 100. Avoid really long methods.
        Open

          protected static function initPropertyMapDefinition() {
            static::$propertyMapDefinition
              ->addPropertyMap(
                new PropertyDefinition('idEvent'),
                new PropertyDefinition('id')
        Severity: Minor
        Found in src/Entity/Event.php by phpmd

        Avoid unused parameters such as '$value'.
        Open

          public static function reverseEventTime($value, Event $context) {
        Severity: Minor
        Found in src/Entity/Event.php by phpmd

        UnusedFormalParameter

        Since: 0.2

        Avoid passing parameters to methods or constructors and then not using those parameters.

        Example

        class Foo
        {
            private function bar($howdy)
            {
                // $howdy is not used
            }
        }

        Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

        Avoid unused parameters such as '$value'.
        Open

          public static function transformEventTime($value) {
        Severity: Minor
        Found in src/Entity/Event.php by phpmd

        UnusedFormalParameter

        Since: 0.2

        Avoid passing parameters to methods or constructors and then not using those parameters.

        Example

        class Foo
        {
            private function bar($howdy)
            {
                // $howdy is not used
            }
        }

        Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

        There are no issues that match your filters.

        Category
        Status