pixelfed/pixelfed

View on GitHub
app/Http/Controllers/CuratedRegisterController.php

Summary

Maintainability
D
1 day
Test Coverage

File CuratedRegisterController.php has 350 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
Severity: Minor
Found in app/Http/Controllers/CuratedRegisterController.php - About 4 hrs to fix

    Method stepTwo has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function stepTwo($request)
        {
            if($request->filled('reason')) {
                $request->session()->put('cur-reg.form-reason', $request->input('reason'));
            }
    Severity: Major
    Found in app/Http/Controllers/CuratedRegisterController.php - About 2 hrs to fix

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

          public function resendConfirmationProcess(Request $request)
          {
              $rules = [
                  'email' => [
                      'required',
      Severity: Minor
      Found in app/Http/Controllers/CuratedRegisterController.php - About 1 hr to fix

        Method conciergeFormStore has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function conciergeFormStore(Request $request)
            {
                abort_if($request->user(), 404);
                $request->session()->increment('cur-reg-con-attempt');
                abort_unless(
        Severity: Minor
        Found in app/Http/Controllers/CuratedRegisterController.php - About 1 hr to fix

          Method conciergeStore has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function conciergeStore(Request $request)
              {
                  abort_if($request->user(), 404);
                  $rules = [
                      'sid' => 'required_if:action,email|integer|min:1|max:20000000',
          Severity: Minor
          Found in app/Http/Controllers/CuratedRegisterController.php - About 1 hr to fix

            Avoid too many return statements within this method.
            Open

                                    return $fail('Username cannot be used.');
            Severity: Major
            Found in app/Http/Controllers/CuratedRegisterController.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                      return $fail('Username is invalid. Username must be alpha-numeric and may contain dashes (-), periods (.) and underscores (_).');
              Severity: Major
              Found in app/Http/Controllers/CuratedRegisterController.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return $fail('Email is invalid.');
                Severity: Major
                Found in app/Http/Controllers/CuratedRegisterController.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $request->all();
                  Severity: Major
                  Found in app/Http/Controllers/CuratedRegisterController.php - About 30 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status