pixelfed/pixelfed

View on GitHub

Showing 1,327 of 1,562 total issues

Method handlePollVote has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handlePollVote()
    {
        $activity = $this->payload['object'];
        $actor = $this->actorFirstOrCreate($this->payload['actor']);

Severity: Minor
Found in app/Util/ActivityPub/Inbox.php - About 1 hr to fix

    Method __construct has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($user)
        {
            $avatar = $user ? $user->avatarUrl() : url('/storage/avatars/default.jpg');
            $avatarPath = parse_url($avatar, PHP_URL_PATH);
            $extension = pathinfo($avatarPath, PATHINFO_EXTENSION);
    Severity: Minor
    Found in app/Util/Webfinger/Webfinger.php - About 1 hr to fix

      Method settingsApiUpdateHomeType has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function settingsApiUpdateHomeType($request)
          {
              $this->validate($request, [
                  'registration_status' => 'required|in:open,filtered,closed',
                  'cloud_storage' => 'required',
      Severity: Minor
      Found in app/Http/Controllers/Admin/AdminSettingsController.php - About 1 hr to fix

        Method accountFollowRequestAccept has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method accountMutes has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function accountMutes(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 instagramStepOneStore has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function instagramStepOneStore(Request $request, $uuid)
                {
                    if((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
                        abort(404, 'Feature not enabled');
                    }
            Severity: Minor
            Found in app/Http/Controllers/Import/Instagram.php - About 1 hr to fix

              Method store has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function store(Request $request)
                  {
                      $rules = [
                          'username' => 'required|min:2|max:15|exists:users'
                      ];
              Severity: Minor
              Found in app/Http/Controllers/UserEmailForgotController.php - About 1 hr to fix

                Method transform has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function transform(Status $status)
                    {
                        return [
                          '@context' => [
                            'https://www.w3.org/ns/activitystreams',
                Severity: Minor
                Found in app/Transformer/ActivityPub/StatusTransformer.php - About 1 hr to fix

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

                      public function handleNoteCreate()
                      {
                          $activity = $this->payload['object'];
                          $actor = $this->actorFirstOrCreate($this->payload['actor']);
                          if(!$actor || $actor->domain == null) {
                  Severity: Minor
                  Found in app/Util/ActivityPub/Inbox.php - About 1 hr to fix

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

                        public function handle(): void
                        {
                            if ($this->batch()->cancelled()) {
                                return;
                            }
                    Severity: Minor
                    Found in app/Jobs/ProfilePipeline/ProfilePurgeFollowersByDomain.php - About 1 hr to fix

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

                          protected static function postsGraph()
                          {
                              $ttl = now()->addHours(12);
                              return Cache::remember('admin:dashboard:home:data-postsGraph:v0.1:24hr', $ttl, function() {
                                  $gb = config('database.default') == 'pgsql' ? ['statuses.id', 'created_at'] : DB::raw('Date(created_at)');
                      Severity: Minor
                      Found in app/Services/AdminStatsService.php - About 1 hr to fix

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

                            public function mediaUpdate(Request $request)
                            {
                                $this->validate($request, [
                                    'id' => 'required',
                                    'file' => function () {
                        Severity: Minor
                        Found in app/Http/Controllers/ComposeController.php - About 1 hr to fix

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

                              public function buildPath($id)
                              {
                                  $padded = str_pad($id, 19, 0, STR_PAD_LEFT);
                                  $parts = str_split($padded, 3);
                                  foreach ($parts as $k => $part) {
                          Severity: Minor
                          Found in app/Http/Controllers/AvatarController.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 handle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function handle()
                                  {
                                      $this->info('Running avatar migration...');
                                      $count = Avatar::whereChangeCount(0)->count();
                              
                              
                              Severity: Minor
                              Found in app/Console/Commands/AvatarDefaultMigration.php - About 1 hr to fix

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

                                    protected function uploadAvatarsToCloud()
                                    {
                                        if(!(bool) config_cache('pixelfed.cloud_storage') || !config('instance.avatar.local_to_cloud')) {
                                            $this->error('Enable cloud storage and avatar cloud storage to perform this action');
                                            return;
                                Severity: Minor
                                Found in app/Console/Commands/AvatarStorage.php - About 1 hr to fix

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

                                      public function handle()
                                      {
                                          $tag = $this->argument('tag');
                                          $hashtag = Hashtag::whereName($tag)->orWhere('slug', $tag)->first();
                                          if(!$hashtag) {
                                  Severity: Minor
                                  Found in app/Console/Commands/HashtagRelatedGenerate.php - About 1 hr to fix

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

                                        public function getAudience($scope = false)
                                        {
                                            if($this->remote_url) {
                                                return [];
                                            }
                                    Severity: Minor
                                    Found in app/Profile.php - About 1 hr to fix

                                      Method importActivity has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function importActivity($activity)
                                          {
                                              $profile = $this->profile;
                                              $supported = $this->supported;
                                              $attachments = $activity['object']['attachment'];
                                      Severity: Minor
                                      Found in app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php - About 1 hr to fix

                                        Method fanoutExpiry has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function fanoutExpiry($profile, $activity)
                                            {
                                                $audience = FollowerService::softwareAudience($profile->id, 'pixelfed');
                                        
                                                if(empty($audience)) {
                                        Severity: Minor
                                        Found in app/Jobs/StoryPipeline/StoryDelete.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language