fisharebest/webtrees

View on GitHub
app/Http/RequestHandlers/SetupWizard.php

Summary

Maintainability
C
7 hrs
Test Coverage

File SetupWizard.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * webtrees: online genealogy
 * Copyright (C) 2023 webtrees development team
Severity: Minor
Found in app/Http/RequestHandlers/SetupWizard.php - About 3 hrs to fix

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

        public function handle(ServerRequestInterface $request): ResponseInterface
        {
            $this->layout = 'layouts/setup';
    
            // Some functions need a cache, but we don't have one yet.
    Severity: Minor
    Found in app/Http/RequestHandlers/SetupWizard.php - About 1 hr to fix

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

          private function connectToDatabase(array $data): void
          {
              // Try to create the database, if it does not already exist.
              switch ($data['dbtype']) {
                  case DB::SQLITE:
      Severity: Minor
      Found in app/Http/RequestHandlers/SetupWizard.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

                        return $this->step5Administrator($data);
        Severity: Major
        Found in app/Http/RequestHandlers/SetupWizard.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $this->step6Install($data);
          Severity: Major
          Found in app/Http/RequestHandlers/SetupWizard.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status