fisharebest/webtrees

View on GitHub
app/Services/ModuleService.php

Summary

Maintainability
D
2 days
Test Coverage

File ModuleService.php has 713 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2022 webtrees development team
Severity: Major
Found in app/Services/ModuleService.php - About 1 day to fix

    ModuleService has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ModuleService
    {
        // Components are pieces of user-facing functionality, are managed together in the control panel.
        private const COMPONENTS = [
            ModuleAnalyticsInterface::class,
    Severity: Minor
    Found in app/Services/ModuleService.php - About 2 hrs to fix

      Method all has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function all(bool $include_disabled = false): Collection
          {
              return Registry::cache()->array()->remember('all-modules', function (): Collection {
                  // Modules have a default status, order etc.
                  // We can override these from database settings.
      Severity: Minor
      Found in app/Services/ModuleService.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

                            return $modules->sort($this->moduleComparator());
        Severity: Major
        Found in app/Services/ModuleService.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $modules;
          Severity: Major
          Found in app/Services/ModuleService.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status