owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

        if ($posSlash === false && $posColon === false) {
            $invalidPos = \strlen($id);
        } elseif ($posSlash === false) {
            $invalidPos = $posColon;
        } elseif ($posColon === false) {
Severity: Minor
Found in apps/files_sharing/lib/Controller/ShareesController.php and 2 other locations - About 40 mins to fix
apps/federatedfilesharing/lib/AddressHandler.php on lines 72..80
lib/private/Share/Helper.php on lines 258..266

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

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

    public function restoreVersion($internalPath, $versionId) {
        if ($this->objectStore instanceof IVersionedObjectStorage) {
            $stat = $this->stat($internalPath);
            if ($stat === false) {
                throw new NotFoundException();
Severity: Minor
Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php and 1 other location - About 40 mins to fix
lib/private/Files/ObjectStore/ObjectStoreStorage.php on lines 619..628

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

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

    private function convertPrincipal($principalUri, $toV2 = null) {
        if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
            list(, $name) = \Sabre\Uri\split($principalUri);
            $toV2 = $toV2 === null ? !$this->legacyMode : $toV2;
            if ($toV2) {
Severity: Minor
Found in apps/dav/lib/CalDAV/CalDavBackend.php and 1 other location - About 40 mins to fix
apps/dav/lib/CardDAV/CardDavBackend.php on lines 1081..1091

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

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

        $qb->select('s.*', 'f.fileid', 'f.path')
            ->selectAlias('st.id', 'storage_string_id')
            ->from('share', 's')
            ->leftJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'))
            ->leftJoin('f', 'storages', 'st', $qb->expr()->eq('f.storage', 'st.numeric_id'))
Severity: Minor
Found in lib/private/Share20/DefaultShareProvider.php and 1 other location - About 40 mins to fix
lib/private/Share20/DefaultShareProvider.php on lines 708..713

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

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

        $qb->select('s.*', 'f.fileid', 'f.path')
            ->selectAlias('st.id', 'storage_string_id')
            ->from('share', 's')
            ->leftJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'))
            ->leftJoin('f', 'storages', 'st', $qb->expr()->eq('f.storage', 'st.numeric_id'))
Severity: Minor
Found in lib/private/Share20/DefaultShareProvider.php and 1 other location - About 40 mins to fix
lib/private/Share20/DefaultShareProvider.php on lines 747..752

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

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

        if ($pos !== false) {
            $user = \substr($id, 0, $pos);
            $remote = \substr($id, $pos + 1);
            $remote = $this->fixRemoteURL($remote);
            if (!empty($user) && !empty($remote)) {
Severity: Minor
Found in apps/files_sharing/lib/Controller/ShareesController.php and 1 other location - About 40 mins to fix
apps/federatedfilesharing/lib/AddressHandler.php on lines 89..96

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

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

        $container->registerService('CheckSetupController', function (IContainer $c) {
            return new CheckSetupController(
                $c->query('AppName'),
                $c->query('Request'),
                $c->query('Config'),
Severity: Minor
Found in settings/Application.php and 1 other location - About 40 mins to fix
settings/Application.php on lines 179..189

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

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

        if ($pos !== false) {
            $user = \substr($id, 0, $pos);
            $remote = \substr($id, $pos + 1);
            $remote = $this->fixRemoteURL($remote);
            if (!empty($user) && !empty($remote)) {
Severity: Minor
Found in apps/federatedfilesharing/lib/AddressHandler.php and 1 other location - About 40 mins to fix
apps/files_sharing/lib/Controller/ShareesController.php on lines 559..566

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

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

    public function getContentOfVersion($internalPath, $versionId) {
        if ($this->objectStore instanceof IVersionedObjectStorage) {
            $stat = $this->stat($internalPath);
            if ($stat === false) {
                throw new NotFoundException();
Severity: Minor
Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php and 1 other location - About 40 mins to fix
lib/private/Files/ObjectStore/ObjectStoreStorage.php on lines 630..639

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

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

    private function convertPrincipal($principalUri, $toV2 = null) {
        if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
            list(, $name) = \Sabre\Uri\split($principalUri);
            $toV2 = $toV2 === null ? !$this->legacyMode : $toV2;
            if ($toV2) {
Severity: Minor
Found in apps/dav/lib/CardDAV/CardDavBackend.php and 1 other location - About 40 mins to fix
apps/dav/lib/CalDAV/CalDavBackend.php on lines 1661..1671

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

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

        $container->registerService('CorsController', function (IContainer $c) {
            return new CorsController(
                $c->query('AppName'),
                $c->query('Request'),
                $c->query('UserSession'),
Severity: Minor
Found in settings/Application.php and 1 other location - About 40 mins to fix
settings/Application.php on lines 168..178

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

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 DeleteHandler has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function DeleteHandler(endpoint, paramID, markCallback, removeCallback, undoCallback) {
Severity: Minor
Found in settings/js/users/deleteHandler.js - About 35 mins to fix

    Function 1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    templates['detailsview'] = template({"1":function(container,depth0,helpers,partials,data) {
    Severity: Minor
    Found in apps/files/js/templates/detailsview.handlebars.js - About 35 mins to fix

      Function main has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
      Severity: Minor
      Found in apps/files/js/templates/detailsview.handlebars.js - About 35 mins to fix

        Function 2 has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        },"2":function(container,depth0,helpers,partials,data) {
        Severity: Minor
        Found in apps/files/js/templates/detailsview.handlebars.js - About 35 mins to fix

          Function move has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  move: function(path, destinationPath, allowOverwrite, headers, options) {
          Severity: Minor
          Found in core/js/files/client.js - About 35 mins to fix

            Function filepicker has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                filepicker:function(title, callback, multiselect, mimetypeFilter, modal) {
            Severity: Minor
            Found in core/js/oc-dialogs.js - About 35 mins to fix

              Function translate has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  translate: function(app, text, vars, count, options) {
              Severity: Minor
              Found in core/js/l10n.js - About 35 mins to fix

                Function copy has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        copy: function(path, destinationPath, allowOverwrite, headers, options) {
                Severity: Minor
                Found in core/js/files/client.js - About 35 mins to fix

                  Function unshare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      unshare:function(itemType, itemSource, shareType, shareWith, callback) {
                  Severity: Minor
                  Found in core/js/share.js - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language