pixelfed/pixelfed

View on GitHub

Showing 1,559 of 1,562 total issues

Avoid too many return statements within this method.
Open

                                       return false;
Severity: Major
Found in app/Http/Controllers/PublicApiController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                            return $q->offset($page * 8 - 8);
    Severity: Major
    Found in app/Http/Controllers/DirectMessageController.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return $i && isset($i['account'], $i['url']);
      Severity: Major
      Found in app/Http/Controllers/Api/ApiV1Controller.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return $post;
        Severity: Major
        Found in app/Http/Controllers/Api/ApiV1Controller.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return view('admin.curated-register.index', compact('records', 'filter'));
          Severity: Major
          Found in app/Http/Controllers/AdminCuratedRegisterController.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return response()->json($res, 200, [], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
            Severity: Major
            Found in app/Http/Controllers/Stories/StoryApiV1Controller.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return [
                          'code' => 200,
                          'msg' => 'Success',
                          'token' => $token,
                      ];
              Severity: Major
              Found in app/Http/Controllers/RemoteAuthController.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                                    return $status;
                Severity: Major
                Found in app/Http/Controllers/PublicApiController.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $s;
                  Severity: Major
                  Found in app/Http/Controllers/PublicApiController.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return $r->from_id !== $profile ? [
                                            'id' => (string) $r->from_id,
                                            'name' => $r->author->name,
                                            'username' => $r->author->username,
                                            'avatar' => $r->author->avatarUrl(),
                    Severity: Major
                    Found in app/Http/Controllers/DirectMessageController.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return false;
                      Severity: Major
                      Found in app/Http/Controllers/Api/ApiV1Controller.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return $account && isset($account['id']);
                        Severity: Major
                        Found in app/Http/Controllers/Api/ApiV1Controller.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return [
                                              'id' => 'pfs:'.$profile['id'],
                                              'user' => [
                                                  'id' => (string) $profile['id'],
                                                  'username' => $profile['username'],
                          Severity: Major
                          Found in app/Http/Controllers/Stories/StoryApiV1Controller.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return response()->json($res);
                            Severity: Major
                            Found in app/Http/Controllers/RemoteAuthController.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                          return $q->where('is_nsfw', false);
                              Severity: Major
                              Found in app/Http/Controllers/PublicApiController.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                        return $q->offset($page * 8 - 8);
                                Severity: Major
                                Found in app/Http/Controllers/DirectMessageController.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return $settings->show_profile_follower_count == false;
                                  Severity: Major
                                  Found in app/Transformer/Api/AccountTransformer.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            return $domain;
                                    Severity: Major
                                    Found in app/Console/Commands/DeleteUserDomainBlock.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                              return;
                                      Severity: Major
                                      Found in app/Console/Commands/CloudMediaMigrate.php - About 30 mins to fix

                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                        Open

                                                } else if($action === 'cw') {
                                                    ModLogService::boot()
                                                        ->objectUid($profile->id)
                                                        ->objectId($profile->id)
                                                        ->objectType('App\Profile::class')
                                        Severity: Minor
                                        Found in app/Http/Controllers/Api/AdminApiController.php and 2 other locations - About 30 mins to fix
                                        app/Http/Controllers/Api/AdminApiController.php on lines 619..680
                                        app/Http/Controllers/Api/AdminApiController.php on lines 649..680

                                        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 90.

                                        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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language