jon48/webtrees-lib

View on GitHub

Showing 758 of 758 total issues

Method handle has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $tree = Validator::attributes($request)->tree();

        if ($this->module === null) {

    Method run has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function run(TaskSchedule $task_schedule): bool
        {
            if ($this->module === null) {
                return false;
            }
    Severity: Minor
    Found in app/Module/AdminTasks/Tasks/HealthCheckEmailTask.php - About 1 hr to fix

      Method handle has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function handle(ServerRequestInterface $request): ResponseInterface
          {
              if ($this->module === null) {
                  throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
              }

        Method loadRoutes has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function loadRoutes(Map $router): void
            {
                $router->attach('', '', static function (Map $router): void {
        
                    $router->attach('', '/module-maj/geodispersion', static function (Map $router): void {
        Severity: Minor
        Found in app/Module/GeoDispersion/GeoDispersionModule.php - About 1 hr to fix

          Method handle has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function handle(ServerRequestInterface $request): ResponseInterface
              {
                  if ($this->module === null) {
                      throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
                  }
          Severity: Minor
          Found in app/Module/Sosa/Http/RequestHandlers/MissingAncestorsList.php - About 1 hr to fix

            Method handle has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function handle(ServerRequestInterface $request): ResponseInterface
                {
                    $tree = Validator::attributes($request)->tree();
            
                    if ($this->module === null) {

              Function upgrade has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function upgrade(): void
                  {
                      if (!DB::schema()->hasTable('maj_geodispersion')) {
                          return;
                      }
              Severity: Minor
              Found in app/Module/GeoDispersion/Schema/Migration2.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                  public function buildLineages(): ?Collection
                  {
                      $indis = $this->patrolineage_module->individuals(
                          $this->tree,
                          $this->surname,
              Severity: Minor
              Found in app/Module/PatronymicLineage/Model/LineageBuilder.php - About 1 hr to fix

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

                    public function generationDepthStatsAtGeneration(int $gen): Collection
                    {
                        if (!$this->isPdoSupported()) {
                            return collect();
                        }
                Severity: Minor
                Found in app/Module/Sosa/Services/SosaStatisticsService.php - About 1 hr to fix

                  Avoid excessively long class names like SosaIndividualDatatablesExtenderInterface. Keep class name length under 40.
                  Open

                  interface SosaIndividualDatatablesExtenderInterface extends HookInterface
                  {
                      /**
                       * Get the columns to be added to ancestors datatables
                       *

                  LongClassName

                  Since: 2.9

                  Detects when classes or interfaces are declared with excessively long names.

                  Example

                  class ATooLongClassNameThatHintsAtADesignProblem {
                  
                  }
                  
                  interface ATooLongInterfaceNameThatHintsAtADesignProblem {
                  
                  }

                  Source https://phpmd.org/rules/naming.html#longclassname

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

                      public function __construct(ModuleInterface $module, SourceStatusService $source_status_service)

                  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

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

                          $permission_preference = $route->extras['permission_preference'] ?? '';

                  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

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

                          $source_status_service = app(SourceStatusService::class);

                  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

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

                      private TaskScheduleService $taskschedules_service;

                  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

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

                      private UrlObfuscatorService $url_obfuscator_service;

                  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

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

                      private TaskScheduleService $taskschedules_service;

                  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

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

                          TaskScheduleService $taskschedules_service

                  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

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

                      private GeoAnalysisDataService $geoanalysis_data_service;

                  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

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

                      public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service)

                  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

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

                      private MapDefinitionsService $mapdefinition_service;

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language