digitalbiblesociety/dbp

View on GitHub

Showing 65 of 67 total issues

Avoid too many return statements within this method.
Open

        return $this->reply($fileset_chapters, [], $transaction_id ?? '');
Severity: Major
Found in app/Http/Controllers/Bible/BibleFileSetsController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $this->setStatusCode(200)->reply(fractal($project, ProjectTransformer::class)->addMeta(['message' => trans('api.projects_created_200')]));
    Severity: Major
    Found in app/Http/Controllers/Organization/ProjectsController.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $session_param;
      Severity: Major
      Found in app/Helpers/Helpers.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return response()->make($formatter->toCsv(), $this->statusCode)
                                         ->header('Content-Type', 'text/csv; charset=utf-8');
        Severity: Major
        Found in app/Http/Controllers/APIController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $this->setStatusCode(404)->replyWithError('No Fileset Chapters Found for the provided params');
          Severity: Major
          Found in app/Http/Controllers/Bible/BibleFileSetsController.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return fractal($this->generateFilesetChapters($fileset, $fileset_chapters, $bible, $asset_id), new FileSetTransformer(), $this->serializer);
            Severity: Major
            Found in app/Http/Controllers/Bible/BibleFileSetsController.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $this->setStatusCode(401)->replyWithError(trans('api.projects_developer_not_a_member', [], $GLOBALS['i18n_iso']));
              Severity: Major
              Found in app/Http/Controllers/User/UsersController.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $this->reply($access_group);
                Severity: Major
                Found in app/Http/Controllers/User/AccessGroupController.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return fractal($chapters, new BookTransformer(), $this->serializer);
                  Severity: Major
                  Found in app/Http/Controllers/Bible/BooksControllerV2.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return view('dashboard.projects.show', compact('user', 'project'));
                    Severity: Major
                    Found in app/Http/Controllers/Organization/ProjectsController.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return [];
                      Severity: Major
                      Found in app/Http/Controllers/Bible/LibraryController.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                            return $this->setStatusCode(404)->replyWithError(trans('api.projects_404'));
                        Severity: Major
                        Found in app/Http/Controllers/User/UsersController.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return [];
                          Severity: Major
                          Found in app/Transformers/BibleTransformer.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return response()->json($object, $this->statusCode, [], JSON_UNESCAPED_UNICODE)
                                                    ->header('Content-Type', 'application/json; charset=utf-8')->setCallback($input);
                            Severity: Major
                            Found in app/Http/Controllers/APIController.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return $this->reply(['success' => 'User updated', 'user' => $user]);
                              Severity: Major
                              Found in app/Http/Controllers/User/UsersController.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return $this->reply($chapters);
                                Severity: Major
                                Found in app/Http/Controllers/Bible/BooksControllerV2.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return $this->setStatusCode(401)->replyWithError(trans('api.projects_users_needs_to_connect', [], $GLOBALS['i18n_iso']));
                                  Severity: Major
                                  Found in app/Http/Controllers/User/UsersController.php - About 30 mins to fix

                                    Function signedPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function signedPath($bible, $fileset, $fileset_chapter)
                                        {
                                            switch ($fileset->set_type_code) {
                                                case 'audio_drama':
                                                case 'audio':
                                    Severity: Minor
                                    Found in app/Http/Controllers/Bible/BibleFileSetsController.php - About 25 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Function sync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function sync()
                                        {
                                            set_time_limit(0);
                                            ini_set('memory_limit', '500M');
                                            $storage = Storage::disk('data');
                                    Severity: Minor
                                    Found in app/Console/Commands/Resources/SyncGlobalRecordingsNetwork.php - About 25 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Function hslToRgb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function hslToRgb($hue, $saturation, $lightness)
                                        {
                                            $c = (1 - abs(2 * $lightness - 1)) * $saturation;
                                            $x = $c * (1 - abs(fmod($hue / 60, 2) - 1));
                                            $m = $lightness - ($c / 2);
                                    Severity: Minor
                                    Found in app/Http/Controllers/User/HighlightsController.php - About 25 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language