interfasys/galleryplus

View on GitHub
appinfo/application.php

Summary

Maintainability
F
5 days
Test Coverage

Method __construct has 336 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(array $urlParams = []) {
        parent::__construct('gallery', $urlParams);

        $container = $this->getContainer();

Severity: Major
Found in appinfo/application.php - About 1 day to fix

    File application.php has 375 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Gallery
     *
     * This file is licensed under the Affero General Public License version 3 or
    Severity: Minor
    Found in appinfo/application.php - About 5 hrs to fix

      Avoid too many return statements within this method.
      Open

                      return new EventSource();
      Severity: Major
      Found in appinfo/application.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return $c->getServer()
                             ->getUserFolder($c->query('UserId'));
        Severity: Major
        Found in appinfo/application.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return $c->query('UtilityContainer')
                                   ->query('OCA\OcUtility\Service\Helper');
          Severity: Major
          Found in appinfo/application.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return $c->getServer()
                                 ->getSession();
            Severity: Major
            Found in appinfo/application.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return new SmarterLogger(
                                      $c->query('AppName'),
                                      $c->query('OCP\ILogger')
                                  );
              Severity: Major
              Found in appinfo/application.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return new FilesPublicController(
                                    $c->query('AppName'),
                                    $c->query('Request'),
                                    $c->query('OCP\IURLGenerator'),
                                    $c->query('SearchFolderService'),
                Severity: Major
                Found in appinfo/application.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $c->query('Request')
                                       ->getParam('token');
                  Severity: Major
                  Found in appinfo/application.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return $c->query('OCP\ILogger');
                    Severity: Major
                    Found in appinfo/application.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return new PreviewApiController(
                                          $c->query('AppName'),
                                          $c->query('Request'),
                                          $c->query('OCP\IURLGenerator'),
                                          $c->query('ConfigService'),
                      Severity: Major
                      Found in appinfo/application.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return new ThumbnailService();
                        Severity: Major
                        Found in appinfo/application.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return new PreviewService(
                                              $c->query('AppName'),
                                              $c->query('Environment'),
                                              $c->query('CustomPreviewManager'),
                                              $c->query('Logger')
                          Severity: Major
                          Found in appinfo/application.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return new Environment(
                                                $c->query('AppName'),
                                                $c->query('UserId'),
                                                $c->query('UserFolder'),
                                                $c->query('OCP\IUserManager'),
                            Severity: Major
                            Found in appinfo/application.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return new SearchFolderService(
                                                  $c->query('AppName'),
                                                  $c->query('Environment'),
                                                  $c->query('Logger')
                                              );
                              Severity: Major
                              Found in appinfo/application.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return new FilesApiController(
                                                    $c->query('AppName'),
                                                    $c->query('Request'),
                                                    $c->query('OCP\IURLGenerator'),
                                                    $c->query('SearchFolderService'),
                                Severity: Major
                                Found in appinfo/application.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return $c->getServer()
                                                       ->getL10N('gallery'); // Keep the same translations
                                  Severity: Major
                                  Found in appinfo/application.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return new ConfigParser();
                                    Severity: Major
                                    Found in appinfo/application.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      return new Preview(
                                                          $c->query('OCP\IConfig'),
                                                          $c->query('OCP\IPreview'),
                                                          $c->query('Logger')
                                                      );
                                      Severity: Major
                                      Found in appinfo/application.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                        return new PreviewController(
                                                            $c->query('AppName'),
                                                            $c->query('Request'),
                                                            $c->query('OCP\IURLGenerator'),
                                                            $c->query('ConfigService'),
                                        Severity: Major
                                        Found in appinfo/application.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          return new FilesController(
                                                              $c->query('AppName'),
                                                              $c->query('Request'),
                                                              $c->query('OCP\IURLGenerator'),
                                                              $c->query('SearchFolderService'),
                                          Severity: Major
                                          Found in appinfo/application.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                            return new DownloadService(
                                                                $c->query('AppName'),
                                                                $c->query('Environment'),
                                                                $c->query('Logger')
                                                            );
                                            Severity: Major
                                            Found in appinfo/application.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                              return new ConfigService(
                                                                  $c->query('AppName'),
                                                                  $c->query('Environment'),
                                                                  $c->query('ConfigParser'),
                                                                  $c->query('CustomPreviewManager'),
                                              Severity: Major
                                              Found in appinfo/application.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                return new EnvCheckMiddleware(
                                                                    $c->query('AppName'),
                                                                    $c->query('Request'),
                                                                    $c->query('OCP\Security\IHasher'),
                                                                    $c->query('Session'),
                                                Severity: Major
                                                Found in appinfo/application.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                  return new PreviewPublicController(
                                                                      $c->query('AppName'),
                                                                      $c->query('Request'),
                                                                      $c->query('OCP\IURLGenerator'),
                                                                      $c->query('ConfigService'),
                                                  Severity: Major
                                                  Found in appinfo/application.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                        return $app->getContainer();
                                                    Severity: Major
                                                    Found in appinfo/application.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                      return new SearchMediaService(
                                                                          $c->query('AppName'),
                                                                          $c->query('Environment'),
                                                                          $c->query('Logger')
                                                                      );
                                                      Severity: Major
                                                      Found in appinfo/application.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                        return new SharingCheckMiddleware(
                                                                            $c->query('AppName'),
                                                                            $c->query('Request'),
                                                                            $c->query('OCP\IConfig'),
                                                                            $c->query('OCP\AppFramework\Utility\IControllerMethodReflector'),
                                                        Severity: Major
                                                        Found in appinfo/application.php - About 30 mins to fix

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

                                                                  $container->registerService(
                                                                      'FilesController',
                                                                      function (IContainer $c) {
                                                                          return new FilesController(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 139..154
                                                          appinfo/application.php on lines 155..170
                                                          appinfo/application.php on lines 171..186
                                                          appinfo/application.php on lines 187..202
                                                          appinfo/application.php on lines 203..218
                                                          appinfo/application.php on lines 417..432

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

                                                          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

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

                                                                  $container->registerService(
                                                                      'PreviewController',
                                                                      function (IContainer $c) {
                                                                          return new PreviewController(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 123..138
                                                          appinfo/application.php on lines 139..154
                                                          appinfo/application.php on lines 155..170
                                                          appinfo/application.php on lines 187..202
                                                          appinfo/application.php on lines 203..218
                                                          appinfo/application.php on lines 417..432

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

                                                          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

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

                                                                  $container->registerService(
                                                                      'PreviewApiController',
                                                                      function (IContainer $c) {
                                                                          return new PreviewApiController(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 123..138
                                                          appinfo/application.php on lines 139..154
                                                          appinfo/application.php on lines 155..170
                                                          appinfo/application.php on lines 171..186
                                                          appinfo/application.php on lines 187..202
                                                          appinfo/application.php on lines 417..432

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

                                                          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

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

                                                                  $container->registerService(
                                                                      'FilesApiController',
                                                                      function (IContainer $c) {
                                                                          return new FilesApiController(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 123..138
                                                          appinfo/application.php on lines 139..154
                                                          appinfo/application.php on lines 171..186
                                                          appinfo/application.php on lines 187..202
                                                          appinfo/application.php on lines 203..218
                                                          appinfo/application.php on lines 417..432

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

                                                          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

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

                                                                  $container->registerService(
                                                                      'PreviewPublicController',
                                                                      function (IContainer $c) {
                                                                          return new PreviewPublicController(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 123..138
                                                          appinfo/application.php on lines 139..154
                                                          appinfo/application.php on lines 155..170
                                                          appinfo/application.php on lines 171..186
                                                          appinfo/application.php on lines 203..218
                                                          appinfo/application.php on lines 417..432

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

                                                          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

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

                                                                  $container->registerService(
                                                                      'FilesPublicController',
                                                                      function (IContainer $c) {
                                                                          return new FilesPublicController(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 123..138
                                                          appinfo/application.php on lines 155..170
                                                          appinfo/application.php on lines 171..186
                                                          appinfo/application.php on lines 187..202
                                                          appinfo/application.php on lines 203..218
                                                          appinfo/application.php on lines 417..432

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

                                                          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

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

                                                                  $container->registerService(
                                                                      'EnvCheckMiddleware',
                                                                      function (IContainer $c) {
                                                                          return new EnvCheckMiddleware(
                                                                              $c->query('AppName'),
                                                          Severity: Major
                                                          Found in appinfo/application.php and 6 other locations - About 1 hr to fix
                                                          appinfo/application.php on lines 123..138
                                                          appinfo/application.php on lines 139..154
                                                          appinfo/application.php on lines 155..170
                                                          appinfo/application.php on lines 171..186
                                                          appinfo/application.php on lines 187..202
                                                          appinfo/application.php on lines 203..218

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

                                                          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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status