pixelfed/pixelfed

View on GitHub

Showing 1,327 of 1,560 total issues

Method embed has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function embed(Request $request, $username)
    {
        $res = view('profile.embed-removed');

        if (! (bool) config_cache('instance.embed.profile')) {
Severity: Minor
Found in app/Http/Controllers/ProfileController.php - About 1 hr to fix

    Method settingsApiUpdateMediaType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function settingsApiUpdateMediaType($request)
        {
            $this->validate($request, [
                'image_quality' => 'required|integer|min:1|max:100',
                'max_album_length' => 'required|integer|min:1|max:20',
    Severity: Minor
    Found in app/Http/Controllers/Admin/AdminSettingsController.php - About 1 hr to fix

      Method passwordUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function passwordUpdate(Request $request)
          {
              $this->validate($request, [
              'current'                => 'required|string',
              'password'               => 'required|string',
      Severity: Minor
      Found in app/Http/Controllers/Settings/HomeSettings.php - About 1 hr to fix

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

            public function store(Request $request)
            {
                abort_unless($request->user(), 404);
        
                $this->validate($request, [
        Severity: Minor
        Found in app/Http/Controllers/PortfolioController.php - About 1 hr to fix

          Method hashtagsApi has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function hashtagsApi(Request $request)
              {
                  $this->validate($request, [
                      'action' => 'sometimes|in:banned,nsfw',
                      'sort' => 'sometimes|in:id,name,cached_count,can_search,can_trend,is_banned,is_nsfw',
          Severity: Minor
          Found in app/Http/Controllers/Admin/AdminHashtagsController.php - About 1 hr to fix

            Method apiEmailCheck has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Method statusState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function statusState(Request $request, $username, int $postid)
                  {
                      $profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
                      $status = Status::whereProfileId($profile->id)->findOrFail($postid);
                      $this->scopeCheck($profile, $status);
              Severity: Minor
              Found in app/Http/Controllers/PublicApiController.php - About 1 hr to fix

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

                    public function handle()
                    {
                        if(config('app.env') !== 'local') {
                            $this->error('This command is meant for development purposes and should only be run in a local environment');
                            return Command::FAILURE;
                Severity: Minor
                Found in app/Console/Commands/ExportLanguages.php - About 1 hr to fix

                  Method actorObject has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function actorObject($profile)
                      {
                          $permalink = $profile->permalink();
                          return [
                              'id'                        => $permalink,
                  Severity: Minor
                  Found in app/Console/Commands/SendUpdateActor.php - About 1 hr to fix

                    Function Blob has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function Blob (chunks, opts) {
                          chunks = chunks || []
                          opts = opts == null ? {} : opts
                          for (var i = 0, len = chunks.length; i < len; i++) {
                            var chunk = chunks[i]
                    Severity: Minor
                    Found in resources/assets/js/polyfill.js - About 1 hr to fix

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

                          public function handle(): void
                          {
                              if(!config('exp.cached_home_timeline')) {
                                  return;
                              }
                      Severity: Minor
                      Found in app/Jobs/HomeFeedPipeline/FeedRemoveDomainPipeline.php - About 1 hr to fix

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

                            public function handle()
                            {
                                $media = $this->media;
                                if(!$media) {
                                    return;
                        Severity: Minor
                        Found in app/Jobs/ImageOptimizePipeline/ImageUpdate.php - About 1 hr to fix

                          Method hashtags has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function hashtags()
                              {
                                  $mastodonMode = self::$mastodonMode;
                                  $q = $this->query->input('q');
                                  $limit = $this->query->input('limit') ?? 20;
                          Severity: Minor
                          Found in app/Services/SearchApiV2Service.php - About 1 hr to fix

                            Method show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function show(Request $request, $username)
                                {
                                    if ($request->wantsJson() && (bool) config_cache('federation.activitypub.enabled')) {
                                        $user = $this->getCachedUser($username, true);
                                        abort_if(! $user, 404, 'Not found');
                            Severity: Minor
                            Found in app/Http/Controllers/ProfileController.php - About 1 hr to fix

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

                                  public function handle($request, Closure $next)
                                  {
                                      $ar = [
                                          'login', 
                                          'logout',
                              Severity: Minor
                              Found in app/Http/Middleware/AccountInterstitial.php - About 1 hr to fix

                                Method reportMailVerifications has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function reportMailVerifications(Request $request)
                                    {
                                        $ids = Redis::smembers('email:manual');
                                        $ignored = Redis::smembers('email:manual-ignored');
                                        $reports = [];
                                Severity: Minor
                                Found in app/Http/Controllers/Admin/AdminReportController.php - About 1 hr to fix

                                  Method getTrending has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function getTrending()
                                      {
                                          $minId = self::getMinRecentId();
                                  
                                          $skipIds = array_merge(self::getBannedHashtags(), self::getNonTrendingHashtags(), self::getNsfwHashtags());
                                  Severity: Minor
                                  Found in app/Services/TrendingHashtagService.php - About 1 hr to fix

                                    Method media has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function media(Request $request)
                                        {
                                            $this->validate($request, [
                                                'layout' => [
                                                    'nullable',
                                    Severity: Minor
                                    Found in app/Http/Controllers/Admin/AdminMediaController.php - About 1 hr to fix

                                      Method directoryDeleteBannerImage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function directoryDeleteBannerImage(Request $request)
                                          {
                                              $bannerImage = ConfigCache::whereK('app.banner_image')->first();
                                              $directory = ConfigCache::whereK('pixelfed.directory')->first();
                                              if (! $bannerImage && ! $directory || empty($directory->v)) {
                                      Severity: Minor
                                      Found in app/Http/Controllers/Admin/AdminDirectoryController.php - About 1 hr to fix

                                        Method getUser has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

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