pixelfed/pixelfed

View on GitHub

Showing 1,555 of 1,558 total issues

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

    public function store(Request $request)
    {
        abort_unless(config('import.instagram.enabled'), 404);
        $this->checkPermissions($request);

Severity: Major
Found in app/Http/Controllers/ImportPostController.php - About 2 hrs to fix

    Method conversations has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method outbox has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function outbox()
          {
              $res = json_encode([
                  "@context" => [
                      "https://www.w3.org/ns/activitystreams",
      Severity: Major
      Found in app/Http/Controllers/InstanceActorController.php - About 2 hrs to fix

        Method stepTwo has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function stepTwo($request)
            {
                if($request->filled('reason')) {
                    $request->session()->put('cur-reg.form-reason', $request->input('reason'));
                }
        Severity: Major
        Found in app/Http/Controllers/CuratedRegisterController.php - About 2 hrs to fix

          ApiV1Dot1Controller has 23 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class ApiV1Dot1Controller extends Controller
          {
              protected $fractal;
          
              public function __construct()
          Severity: Minor
          Found in app/Http/Controllers/Api/ApiV1Dot1Controller.php - About 2 hrs to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                public function remoteLikeDeliver()
                {
                    $like = $this->like;
                    $status = $this->like->status;
                    $actor = $this->like->actor;
            Severity: Major
            Found in app/Jobs/LikePipeline/LikePipeline.php and 1 other location - About 2 hrs to fix
            app/Jobs/LikePipeline/UnlikePipeline.php on lines 93..107

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 131.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                public function remoteLikeDeliver()
                {
                    $like = $this->like;
                    $status = $this->like->status;
                    $actor = $this->like->actor;
            Severity: Major
            Found in app/Jobs/LikePipeline/UnlikePipeline.php and 1 other location - About 2 hrs to fix
            app/Jobs/LikePipeline/LikePipeline.php on lines 97..111

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 131.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                        '@context' => [
                            'https://w3id.org/security/v1',
                            'https://www.w3.org/ns/activitystreams',
                            [
                                'Hashtag'             => 'as:Hashtag',
            Severity: Major
            Found in app/Transformer/ActivityPub/Verb/CreateNote.php and 1 other location - About 2 hrs to fix
            app/Transformer/ActivityPub/Verb/Note.php on lines 56..88

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 131.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                        '@context' => [
                            'https://w3id.org/security/v1',
                            'https://www.w3.org/ns/activitystreams',
                            [
                                'Hashtag'             => 'as:Hashtag',
            Severity: Major
            Found in app/Transformer/ActivityPub/Verb/Note.php and 1 other location - About 2 hrs to fix
            app/Transformer/ActivityPub/Verb/CreateNote.php on lines 55..87

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 131.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method unlinkRemoveMedia has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function unlinkRemoveMedia($status)
                {
            
                    if($status->in_reply_to_id) {
                        $parent = Status::find($status->in_reply_to_id);
            Severity: Major
            Found in app/Jobs/StatusPipeline/RemoteStatusDelete.php - About 2 hrs to fix

              Method profileUpdateOrCreate has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function profileUpdateOrCreate($url)
                  {
                      $res = self::fetchProfileFromUrl($url);
                      if (! $res || isset($res['id']) == false) {
                          return;
              Severity: Major
              Found in app/Util/ActivityPub/Helpers.php - About 2 hrs to fix

                Method buildProfile has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function buildProfile(Request $request, $user)
                    {
                        $username = $user->username;
                        $loggedIn = Auth::check();
                        $isPrivate = false;
                Severity: Major
                Found in app/Http/Controllers/ProfileController.php - About 2 hrs to fix

                  File CollectionController.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace App\Http\Controllers;
                  
                  use Illuminate\Http\Request;
                  Severity: Minor
                  Found in app/Http/Controllers/CollectionController.php - About 2 hrs to fix

                    Method accountEmailsFromPixelfed has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function accountEmailsFromPixelfed(Request $request)
                        {
                            abort_if(!$request->user() || !$request->user()->token(), 403);
                            abort_unless($request->user()->tokenCan('read'), 403);
                    
                    
                    Severity: Major
                    Found in app/Http/Controllers/Api/ApiV1Dot1Controller.php - About 2 hrs to fix

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

                          public function handle()
                          {
                              $actor = $this->actor;
                              $target = $this->target;
                      
                      
                      Severity: Major
                      Found in app/Jobs/FollowPipeline/UnfollowPipeline.php - About 2 hrs to fix

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

                            public function handle(): void
                            {
                                if((bool) config_cache('pixelfed.cloud_storage') === false) {
                                    return;
                                }
                        Severity: Major
                        Found in app/Jobs/VideoPipeline/VideoThumbnailToCloudPipeline.php - About 2 hrs to fix

                          Method verifySignature has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function verifySignature($headers, $payload)
                              {
                                  $body = $this->payload;
                                  $bodyDecoded = $payload;
                                  $signature = is_array($headers['signature']) ? $headers['signature'][0] : $headers['signature'];
                          Severity: Major
                          Found in app/Jobs/InboxPipeline/DeleteWorker.php - About 2 hrs to fix

                            Method settingsApiUpdateUsersType has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function settingsApiUpdateUsersType($request)
                                {
                                    $this->validate($request, [
                                        'require_email_verification' => 'required',
                                        'enforce_account_limit' => 'required',
                            Severity: Major
                            Found in app/Http/Controllers/Admin/AdminSettingsController.php - About 2 hrs to fix

                              Method getAutospamConfigApi has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getAutospamConfigApi(Request $request)
                                  {
                                      $open = Cache::remember('admin-dash:reports:spam-count', 3600, function() {
                                          return AccountInterstitial::whereType('post.autospam')->whereNull('appeal_handled_at')->count();
                                      });
                              Severity: Major
                              Found in app/Http/Controllers/Admin/AdminAutospamController.php - About 2 hrs to fix

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

                                    public function store(Request $request)
                                    {
                                        if (Auth::check() === false) {
                                            abort(403);
                                        }
                                Severity: Major
                                Found in app/Http/Controllers/CommentController.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language