pixelfed/pixelfed

View on GitHub

Showing 1,326 of 1,561 total issues

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

    public function handle()
    {
        $localDisk = Storage::disk('local');
        $cloudDisk = Storage::disk('backup');
        $backupDestination = new BackupDestination($localDisk, '', 'local');
Severity: Minor
Found in app/Console/Commands/BackupToCloud.php - About 1 hr to fix

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

        public function handle()
        {
            $status = $this->status;
            $parent = Status::find($this->status->reblog_of_id);
            if (! $parent) {
    Severity: Minor
    Found in app/Jobs/SharePipeline/SharePipeline.php - About 1 hr to fix

      Method mapInvite has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function mapInvite($id, $data = [])
          {
              $roles = self::get($id);
      
              $map = [
      Severity: Minor
      Found in app/Services/UserRoleService.php - About 1 hr to fix

        Method get has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function get($account, $version = 1)
            {
                $mh = hash('sha256', date('Y').'-.-'.date('m'));
                
                if($account instanceOf User) {
        Severity: Minor
        Found in app/Services/MediaPathService.php - About 1 hr to fix

          Method mapActions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function mapActions($id, $data = [])
              {
                  $res = [];
                  $map = [
                      'account-force-private' => 'private',
          Severity: Minor
          Found in app/Services/UserRoleService.php - About 1 hr to fix

            Method storage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function storage()
                {
                    return Cache::remember('admin:dashboard:storage:stats', 120000, function() {
                        $res = [];
            
            
            Severity: Minor
            Found in app/Services/AdminStatsService.php - About 1 hr to fix

              Method blocks has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function blocks(int $profile_id)
                  {
                      $key = self::USER_BLOCKS_KEY . $profile_id;
                      $warm = Cache::has($key . ':cached-v0');
                      if($warm) {
              Severity: Minor
              Found in app/Services/UserFilterService.php - About 1 hr to fix

                Method mutes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function mutes(int $profile_id)
                    {
                        $key = self::USER_MUTES_KEY . $profile_id;
                        $warm = Cache::has($key . ':cached-v0');
                        if($warm) {
                Severity: Minor
                Found in app/Services/UserFilterService.php - About 1 hr to fix

                  Method userDeleteProcess has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function userDeleteProcess(Request $request, $id)
                      {
                          $user = User::findOrFail($id);
                          $profile = $user->profile;
                  
                  
                  Severity: Minor
                  Found in app/Http/Controllers/Admin/AdminUserController.php - About 1 hr to fix

                    Method accountSearch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function accountSearch(Request $request)
                        {
                            abort_if(! $request->user() || ! $request->user()->token(), 403);
                            abort_unless($request->user()->tokenCan('read'), 403);
                    
                    
                    Severity: Minor
                    Found in app/Http/Controllers/Api/ApiV1Controller.php - About 1 hr to fix

                      Method sessionGetMastodonData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function sessionGetMastodonData(Request $request)
                          {
                              abort_unless((
                                  config_cache('pixelfed.open_registration') &&
                                  config('remote-auth.mastodon.enabled')
                      Severity: Minor
                      Found in app/Http/Controllers/RemoteAuthController.php - About 1 hr to fix

                        Method userProfile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function userProfile($user)
                            {
                                if (empty($user->profile)) {
                                    if($user->created_at->lt(now()->subDays(1)) && empty($user->status)) {
                                        $p = Profile::withTrashed()->whereUserId($user->id)->first();
                        Severity: Minor
                        Found in app/Listeners/AuthLogin.php - About 1 hr to fix

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

                              public function handle(): void
                              {
                                  $hashtag = $this->hashtag;
                                  $sid = $hashtag->status_id;
                                  $status = StatusService::get($sid, false);
                          Severity: Minor
                          Found in app/Jobs/HomeFeedPipeline/HashtagInsertFanoutPipeline.php - About 1 hr to fix

                            Method verifyAttachments has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function verifyAttachments($data)
                                {
                                    if (! isset($data['object']) || empty($data['object'])) {
                                        $data = ['object' => $data];
                                    }
                            Severity: Minor
                            Found in app/Util/ActivityPub/Helpers.php - About 1 hr to fix

                              Method cloudMove has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function cloudMove($media)
                                  {
                                      if (! Storage::exists($media->media_path)) {
                                          return 'invalid file';
                                      }
                              Severity: Minor
                              Found in app/Services/MediaStorageService.php - About 1 hr to fix

                                Method refetchAllPosts has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function refetchAllPosts()
                                    {
                                        $profile = $this->profile;
                                        $res = ActivityPubFetchService::get($profile->remote_url, false);
                                        if(!$res) {
                                Severity: Minor
                                Found in app/Jobs/AdminPipeline/AdminProfileActionPipeline.php - About 1 hr to fix

                                  Method toArray has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function toArray(Request $request): array
                                      {
                                          $instance = parse_url($this->uri, PHP_URL_HOST);
                                          $statuses = [];
                                          if($this->status_ids && count($this->status_ids)) {
                                  Severity: Minor
                                  Found in app/Http/Resources/AdminRemoteReport.php - About 1 hr to fix

                                    Method fixUncategorizedSpam has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function fixUncategorizedSpam(Request $request)
                                        {
                                            if (Cache::get('admin-dash:reports:spam-sync-active')) {
                                                return redirect('/i/admin/reports/autospam');
                                            }
                                    Severity: Minor
                                    Found in app/Http/Controllers/Admin/AdminReportController.php - About 1 hr to fix

                                      Method importBackup has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function importBackup(Request $request)
                                          {
                                              $this->validate($request, [
                                                  'banned' => 'sometimes|array',
                                                  'auto_cw' => 'sometimes|array',
                                      Severity: Minor
                                      Found in app/Http/Controllers/Admin/AdminInstanceController.php - About 1 hr to fix

                                        Method twoFactorVerify has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function twoFactorVerify(Request $request)
                                            {
                                                $this->validate($request, [
                                                    'code'  => 'required|string|max:32'
                                                ]);
                                        Severity: Minor
                                        Found in app/Http/Controllers/AccountController.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language