owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

            case IMAGETYPE_PNG:
                if (\imagetypes() & IMG_PNG) {
                    $this->resource = \imagecreatefrompng($imagePath);
                    // Preserve transparency
                    \imagealphablending($this->resource, true);
Severity: Major
Found in lib/private/legacy/image.php and 1 other location - About 1 hr to fix
lib/private/legacy/image.php on lines 621..630

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

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 2 locations. Consider refactoring.
Open

            if (!$publicShare) {
                $query = \OC_DB::prepare(
                    '
                    SELECT `share_with`
                    FROM `*PREFIX*share`
Severity: Major
Found in lib/private/Share/Share.php and 1 other location - About 1 hr to fix
lib/private/Share/Share.php on lines 277..295

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

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 2 locations. Consider refactoring.
Open

            if (!$remoteShare) {
                $query = \OC_DB::prepare(
                    '
                    SELECT `share_with`
                    FROM `*PREFIX*share`
Severity: Major
Found in lib/private/Share/Share.php and 1 other location - About 1 hr to fix
lib/private/Share/Share.php on lines 256..274

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

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 2 locations. Consider refactoring.
Open

            case IMAGETYPE_GIF:
                if (\imagetypes() & IMG_GIF) {
                    $this->resource = \imagecreatefromgif($imagePath);
                    // Preserve transparency
                    \imagealphablending($this->resource, true);
Severity: Major
Found in lib/private/legacy/image.php and 1 other location - About 1 hr to fix
lib/private/legacy/image.php on lines 645..654

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

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

Function share has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback, errorCallback) {
Severity: Major
Found in core/js/share.js - About 1 hr to fix

    Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            string $appName,
            IRequest $request,
            MailNotifications $mailNotifications,
            IUserSession $userSession,
            IUserManager $userManager,
    Severity: Major
    Found in apps/files_sharing/lib/Controller/NotificationController.php - About 1 hr to fix

      Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $appName,
              IRequest $request,
              OcmMiddleware $ocmMiddleware,
              IURLGenerator $urlGenerator,
              IUserManager $userManager,
      Severity: Major
      Found in apps/federatedfilesharing/lib/Controller/OcmController.php - About 1 hr to fix

        Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $appName,
                IRequest $request,
                IJobList $jobList,
                ISecureRandom $secureRandom,
                IConfig $config,
        Severity: Major
        Found in apps/updatenotification/lib/Controller/AdminController.php - About 1 hr to fix

          Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $appName,
                  IRequest $request,
                  IURLGenerator $urlGenerator,
                  IL10N $l10n,
                  IConfig $config,
          Severity: Major
          Found in apps/files/lib/Controller/ViewController.php - About 1 hr to fix

            Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    IRequest $request,
                    ControllerMethodReflector $reflector,
                    INavigationManager $navigationManager,
                    IURLGenerator $urlGenerator,
                    ILogger $logger,
            Severity: Major
            Found in lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php - About 1 hr to fix

              Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      IUserManager $manager,
                      ISession $session,
                      ITimeFactory $timeFactory,
                      IProvider $tokenProvider,
                      IConfig $config,
              Severity: Major
              Found in lib/private/User/Session.php - About 1 hr to fix

                Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $appName,
                        IRequest $request,
                        IUserManager $userManager,
                        IConfig $config,
                        ISession $session,
                Severity: Major
                Found in core/Controller/LoginController.php - About 1 hr to fix

                  Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $appName,
                          IRequest $request,
                          IAvatarManager $avatarManager,
                          File $cache,
                          IL10N $l10n,
                  Severity: Major
                  Found in core/Controller/AvatarController.php - About 1 hr to fix

                    Function _addAppPassword has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _addAppPassword: function() {
                                var _this = this;
                    
                                var deviceName = this._tokenName.val();
                                if (!deviceName) {
                    Severity: Minor
                    Found in settings/js/panels/authtoken_view.js - About 1 hr to fix

                      Function getDefaultFileActions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                               getDefaultFileActions: function(mime, type, permissions) {
                                  var mimePart;
                                  if (mime) {
                                      mimePart = mime.substr(0, mime.indexOf('/'));
                                  }
                      Severity: Minor
                      Found in apps/files/js/fileactions.js - About 1 hr to fix

                        Function uploads has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                selection.uploads = _.filter(selection.uploads, function(upload) {
                                    var file = upload.getFile();
                                    if (file.relativePath) {
                                        // can't check in subfolder contents, let backend handle this
                                        return true;
                        Severity: Minor
                        Found in apps/files/js/file-upload.js - About 1 hr to fix

                          Function _legacyFillCurrentShares has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  _legacyFillCurrentShares: function(shares) {
                                      var fileId = this.fileInfoModel.get('id');
                                      if (!shares || !shares.length) {
                                          delete OC.Share.statuses[fileId];
                                          OC.Share.currentShares = {};
                          Severity: Minor
                          Found in core/js/shareitemmodel.js - About 1 hr to fix

                            Function _handleAddShareAttributes has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    _handleAddShareAttributes: function(properties, options) {
                                        var shareAttributesV1 = [];
                                        var filteredRegisteredAttributes = this._filterRegisteredAttributes(properties.permissions);
                                        _.map(filteredRegisteredAttributes, function (filteredRegisteredAttribute) {
                                            var isCompatible = true;
                            Severity: Minor
                            Found in core/js/shareitemmodel.js - About 1 hr to fix

                              Function renderFileResult has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          this.renderFileResult = function($row, result) {
                                              if (inFileList($row, result)) {
                                                  return null;
                                              }
                                              hideNoFilterResults();
                              Severity: Minor
                              Found in apps/files/js/search.js - About 1 hr to fix

                                Function getFileInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        getFileInfo: function(path, options) {
                                            if (!path) {
                                                path = '';
                                            }
                                            options = options || {};
                                Severity: Minor
                                Found in core/js/files/client.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language