Jelle-S/TheSportsDb

View on GitHub
src/Entity/League.php

Summary

Maintainability
B
6 hrs
Test Coverage

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

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

    League has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class League extends Entity implements LeagueInterface {
    
      /**
       * {@inheritdoc}
       */
    Severity: Minor
    Found in src/Entity/League.php - About 2 hrs to fix

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

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

      Avoid unused parameters such as '$context'.
      Open

        public static function transformSeasons($values, $context, EntityManagerInterface $entityManager) {
      Severity: Minor
      Found in src/Entity/League.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