pixelfed/pixelfed

View on GitHub

Showing 1,333 of 1,566 total issues

Method scan has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function scan($text, $activitypub = false)
    {
        if((bool) config_cache('federation.custom_emoji.enabled') == false) {
            return [];
        }
Severity: Minor
Found in app/Models/CustomEmoji.php - About 1 hr to fix

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

        public static function getId($userId, $year, $month, $day)
        {
            if($userId > 999999) {
                return;
            }
    Severity: Minor
    Found in app/Services/ImportService.php - About 1 hr to fix

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

          public function followRequestHandle(Request $request)
          {
              $this->validate($request, [
                  'action' => 'required|string|max:10',
                  'id' => 'required|integer|min:1'
      Severity: Minor
      Found in app/Http/Controllers/AccountController.php - About 1 hr 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 remotePostLookup has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function remotePostLookup()
              {
                  $tag = $this->term;
                  $hash = hash('sha256', $tag);
                  $local = Helpers::validateLocalUrl($tag);
          Severity: Minor
          Found in app/Http/Controllers/SearchController.php - About 1 hr to fix

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

                protected function updateUrls()
                {
                    $this->info('Updating urls...');
                    $oldDomain = trim($this->argument('oldDomain'));
                    $newDomain = trim($this->argument('newDomain'));
            Severity: Minor
            Found in app/Console/Commands/MediaCloudUrlRewrite.php - About 1 hr to fix

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

                  public function handle(): void
                  {
                      $payload = $this->payload;
              
                      if(empty($payload) || !isset($payload['actor'])) {
              Severity: Minor
              Found in app/Jobs/ProfilePipeline/HandleUpdateActivity.php - About 1 hr to fix

                Method handleImmediateAttributes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function handleImmediateAttributes(Status $status, $attributes)
                    {
                        if(isset($attributes['status'])) {
                            $cleaned = Purify::clean($attributes['status']);
                            $status->caption = $cleaned;
                Severity: Minor
                Found in app/Services/Status/UpdateStatusService.php - About 1 hr to fix

                  Method unmute has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function unmute(Request $request)
                      {
                          $this->validate($request, [
                              'type' => 'required|string|in:user',
                              'item' => 'required|integer|min:1',
                  Severity: Minor
                  Found in app/Http/Controllers/AccountController.php - About 1 hr to fix

                    Method unblock has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function unblock(Request $request)
                        {
                            $this->validate($request, [
                                'type' => 'required|string|in:user',
                                'item' => 'required|integer|min:1',
                    Severity: Minor
                    Found in app/Http/Controllers/AccountController.php - About 1 hr to fix

                      Method add has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function add(Request $request)
                          {
                              abort_if(! (bool) config_cache('instance.stories.enabled') || ! $request->user(), 404);
                      
                              $this->validate($request, [
                      Severity: Minor
                      Found in app/Http/Controllers/Stories/StoryApiV1Controller.php - About 1 hr to fix

                        Method myMemories has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function myMemories(Request $request)
                            {
                                abort_if(! $request->user(), 404);
                                $pid = $request->user()->profile_id;
                                abort_if(! $this->config()['memories']['enabled'], 404);
                        Severity: Minor
                        Found in app/Http/Controllers/DiscoverController.php - About 1 hr to fix

                          Method storeId has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

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

                                public function handle()
                                {
                                    if(Schema::hasTable('instance_actors') == false) {
                                        $this->line(' ');
                                        $this->error('Missing instance_actors table.');
                            Severity: Minor
                            Found in app/Console/Commands/GenerateInstanceActor.php - About 1 hr to fix

                              Method validateUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function validateUrl($url)
                                  {
                                      if (is_array($url)) {
                                          $url = $url[0];
                                      }
                              Severity: Minor
                              Found in app/Util/ActivityPub/Helpers.php - About 1 hr to fix

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

                                    protected function handle($status)
                                    {
                                        $media = $status->media;
                                
                                        $ai = new AccountInterstitial;
                                Severity: Minor
                                Found in app/Util/Sentiment/Bouncer.php - About 1 hr to fix

                                  Method storeShare has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function storeShare(Request $request)
                                      {
                                          $this->authCheck();
                                  
                                          $this->validate($request, [
                                  Severity: Minor
                                  Found in app/Http/Controllers/StatusController.php - About 1 hr to fix

                                    Method userModerate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function userModerate(Request $request)
                                        {
                                            $this->validate($request, [
                                                'profile_id' => 'required|exists:profiles,id',
                                                'action' => 'required|in:cw,no_autolink,unlisted'
                                    Severity: Minor
                                    Found in app/Http/Controllers/Admin/AdminUserController.php - About 1 hr to fix

                                      Method getAccountSettings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getAccountSettings(Request $request)
                                          {
                                              $this->validate($request, [
                                                  'id' => 'required|integer'
                                              ]);
                                      Severity: Minor
                                      Found in app/Http/Controllers/PortfolioController.php - About 1 hr to fix

                                        Method accountBlocks has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function accountBlocks(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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language