pixelfed/pixelfed

View on GitHub

Showing 1,326 of 1,561 total issues

Method cropPhoto has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function cropPhoto(Request $request)
    {
        abort_if(! (bool) config_cache('instance.stories.enabled') || ! $request->user(), 404);

        $this->validate($request, [
Severity: Minor
Found in app/Http/Controllers/StoryComposeController.php - About 1 hr to fix

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

        public function store(ProfileMigrationStoreRequest $request)
        {
            abort_if((bool) config_cache('federation.activitypub.enabled') === false, 404);
            $acct = WebfingerService::rawGet($request->safe()->acct);
            if (! $acct) {
    Severity: Minor
    Found in app/Http/Controllers/ProfileMigrationController.php - About 1 hr to fix

      Method settings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function settings(Request $request)
          {
              $cloud_storage = ConfigCacheService::get('pixelfed.cloud_storage');
              $cloud_disk = config('filesystems.cloud');
              $cloud_ready = ! empty(config('filesystems.disks.'.$cloud_disk.'.key')) && ! empty(config('filesystems.disks.'.$cloud_disk.'.secret'));
      Severity: Minor
      Found in app/Http/Controllers/Admin/AdminSettingsController.php - About 1 hr to fix

        Method instanceEdit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method instances has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function instances(Request $request)
              {
                  abort_if(!$request->user() || !$request->user()->token(), 404);
          
                  abort_unless($request->user()->is_admin == 1, 404);
          Severity: Minor
          Found in app/Http/Controllers/Api/AdminApiController.php - About 1 hr to fix

            Method statusById has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function statusById(Request $request, $id)
                {
                    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 notifications has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function notifications(Request $request)
                  {
                      abort_if(!$request->user(), 403);
              
                      $pid = $request->user()->profile_id;
              Severity: Minor
              Found in app/Http/Controllers/Api/BaseApiController.php - About 1 hr to fix

                Method updateFeatures has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function updateFeatures(Request $request)
                    {
                        abort_if(! $request->user(), 404);
                        abort_if(! $request->user()->is_admin, 404);
                        $pid = $request->user()->profile_id;
                Severity: Minor
                Found in app/Http/Controllers/DiscoverController.php - About 1 hr to fix

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

                      public function store(Request $request)
                      {
                          abort_if(!$request->user(), 403);
                  
                          $this->validate($request, [
                  Severity: Minor
                  Found in app/Http/Controllers/Api/V1/DomainBlockController.php - About 1 hr to fix

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

                        public function handleLikeActivity()
                        {
                            $actor = $this->payload['actor'];
                    
                            if(!Helpers::validateUrl($actor)) {
                    Severity: Minor
                    Found in app/Util/ActivityPub/Inbox.php - About 1 hr to fix

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

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

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

                            protected function updateImmediateAttributes($status, $activity)
                            {
                                if (isset($activity['content'])) {
                                    $status->caption = strip_tags($activity['content']);
                                    $status->rendered = Purify::clean($activity['content']);
                        Severity: Minor
                        Found in app/Jobs/StatusPipeline/StatusRemoteUpdatePipeline.php - About 1 hr to fix

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

                              public function handleOrderedCollection()
                              {
                                  $outbox = $this->outbox;
                          
                                  if (!isset($outbox['next']) && !isset($outbox['first']['next']) && $this->cursor !== 1) {
                          Severity: Minor
                          Found in app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php - About 1 hr to fix

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

                                protected function getAudienceInboxes($pid, $scope = null)
                                {
                                    $key = 'pf:services:follower:audience:' . $pid;
                                    $domains = Cache::remember($key, 432000, function() use($pid) {
                                        $profile = Profile::whereNull(['status', 'domain'])->find($pid);
                            Severity: Minor
                            Found in app/Services/FollowerService.php - About 1 hr to fix

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

                                  public function searchMentionAutocomplete(Request $request)
                                  {
                                      abort_if(! $request->user(), 403);
                              
                                      $this->validate($request, [
                              Severity: Minor
                              Found in app/Http/Controllers/ComposeController.php - About 1 hr to fix

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

                                    public function settingsSystem(Request $request)
                                    {
                                        $sys = [
                                            'pixelfed' => config('pixelfed.version'),
                                            'php' => phpversion(),
                                Severity: Minor
                                Found in app/Http/Controllers/Admin/AdminSettingsController.php - About 1 hr to fix

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

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

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

                                        public function getAuthDomains(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 read has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function read(Request $request)
                                          {
                                              $this->validate($request, [
                                                  'id' => 'required',
                                                  'type' => 'required|in:post.cw,post.removed,post.unlist,post.autospam',
                                      Severity: Minor
                                      Found in app/Http/Controllers/AccountInterstitialController.php - About 1 hr to fix

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

                                            public function accountLoginActivity(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/ApiV1Dot1Controller.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language