owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

OC.L10N.register(
    "systemtags",
    {
    "Tags" : "태그",
    "Tagged files" : "태그된 파일",
Severity: Major
Found in apps/systemtags/l10n/ko.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/de_CH.js on lines 1..33
apps/federatedfilesharing/l10n/gl.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/files_sharing/l10n/km.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/ca.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/sv.js on lines 1..33
apps/systemtags/l10n/zh_TW.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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

OC.L10N.register(
    "files_sharing",
    {
    "Uploading..." : "កំពុងដាក់បញ្ចូល...",
    "Cancel" : "បោះបង់",
Severity: Major
Found in apps/files_sharing/l10n/km.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/de_CH.js on lines 1..33
apps/federatedfilesharing/l10n/gl.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/ca.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/ko.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/sv.js on lines 1..33
apps/systemtags/l10n/zh_TW.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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

OC.L10N.register(
    "systemtags",
    {
    "Tags" : "Etiquetes",
    "Tagged files" : "Fitxers marcats",
Severity: Major
Found in apps/systemtags/l10n/ca.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/de_CH.js on lines 1..33
apps/federatedfilesharing/l10n/gl.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/files_sharing/l10n/km.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/ko.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/sv.js on lines 1..33
apps/systemtags/l10n/zh_TW.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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

OC.L10N.register(
    "systemtags",
    {
    "Tags" : "標籤",
    "Tagged files" : "標記文件",
Severity: Major
Found in apps/systemtags/l10n/zh_TW.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/de_CH.js on lines 1..33
apps/federatedfilesharing/l10n/gl.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/files_sharing/l10n/km.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/ca.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/ko.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/sv.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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

OC.L10N.register(
    "systemtags",
    {
    "Tags" : "Taggar",
    "Tagged files" : "Taggade filer",
Severity: Major
Found in apps/systemtags/l10n/sv.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/de_CH.js on lines 1..33
apps/federatedfilesharing/l10n/gl.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/files_sharing/l10n/km.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/ca.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/ko.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/zh_TW.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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

OC.L10N.register(
    "federatedfilesharing",
    {
    "Federated sharing" : "Federated-Sharing",
    "Loading..." : "Laden…",
Severity: Major
Found in apps/federatedfilesharing/l10n/de_CH.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/gl.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/files_sharing/l10n/km.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/ca.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/ko.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/sv.js on lines 1..33
apps/systemtags/l10n/zh_TW.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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

OC.L10N.register(
    "federatedfilesharing",
    {
    "Federated sharing" : "Compartición federada",
    "Loading..." : "Cargando...",
Severity: Major
Found in apps/federatedfilesharing/l10n/gl.js and 19 other locations - About 6 hrs to fix
apps/federatedfilesharing/l10n/ar.js on lines 1..33
apps/federatedfilesharing/l10n/de_CH.js on lines 1..33
apps/federatedfilesharing/l10n/he.js on lines 1..33
apps/federatedfilesharing/l10n/sv.js on lines 1..33
apps/files/l10n/ta.js on lines 1..33
apps/files_sharing/l10n/km.js on lines 1..33
apps/systemtags/l10n/ar.js on lines 1..33
apps/systemtags/l10n/ca.js on lines 1..33
apps/systemtags/l10n/de_CH.js on lines 1..33
apps/systemtags/l10n/gl.js on lines 1..33
apps/systemtags/l10n/is.js on lines 1..33
apps/systemtags/l10n/it.js on lines 1..33
apps/systemtags/l10n/ko.js on lines 1..33
apps/systemtags/l10n/pl.js on lines 1..33
apps/systemtags/l10n/pt_PT.js on lines 1..33
apps/systemtags/l10n/sv.js on lines 1..33
apps/systemtags/l10n/zh_TW.js on lines 1..33
core/l10n/be.js on lines 1..33
core/l10n/fil.js on lines 1..33

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

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 (!empty($search)) {
            // only user backends have the capability to do a complex search for users
            $searchOffset = 0;
            $searchLimit = $limit * 100;
            if ($limit === -1) {
Severity: Major
Found in lib/private/Group/Manager.php and 1 other location - About 6 hrs to fix
lib/private/Group/Manager.php on lines 396..421

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

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 (!empty($search)) {
            // only user backends have the capability to do a complex search for users
            $searchOffset = 0;
            $searchLimit = $limit * 100;
            if ($limit === -1) {
Severity: Major
Found in lib/private/Group/Manager.php and 1 other location - About 6 hrs to fix
lib/private/Group/Manager.php on lines 448..473

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

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

<?php

namespace OCA\Files_Sharing\Migrations;

use Doctrine\DBAL\Schema\Schema;
apps/federatedfilesharing/appinfo/Migrations/Version20170804201253.php on lines 1..30

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

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

<?php

namespace OCA\FederatedFileSharing\Migrations;

use Doctrine\DBAL\Schema\Schema;
apps/files_sharing/appinfo/Migrations/Version20170804201253.php on lines 1..30

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

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 getUsers has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getUsers($search) {
        $this->result['users'] = $this->result['exact']['users'] = $users = [];

        if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
            $this->result['users'] = [];
Severity: Minor
Found in apps/files_sharing/lib/Controller/ShareesController.php - About 6 hrs 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

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

        if (!$schema->hasTable("{$prefix}external_options")) {
            $table = $schema->createTable("{$prefix}external_options");
            $table->addColumn('option_id', 'bigint', [
                'autoincrement' => true,
                'notnull' => true,
Severity: Major
Found in core/Migrations/Version20170111103310.php and 1 other location - About 6 hrs to fix
core/Migrations/Version20170111103310.php on lines 92..115

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

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 newFile($path) {
        if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) {
            $fullPath = $this->getFullPath($path);
            $nonExisting = new NonExistingFile($this->root, $this->view, $fullPath);
            $this->root->emit('\OC\Files', 'preWrite', [$nonExisting]);
Severity: Major
Found in lib/private/Files/Node/Folder.php and 1 other location - About 6 hrs to fix
lib/private/Files/Node/Folder.php on lines 152..166

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

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 newFolder($path) {
        if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) {
            $fullPath = $this->getFullPath($path);
            $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
            $this->root->emit('\OC\Files', 'preWrite', [$nonExisting]);
Severity: Major
Found in lib/private/Files/Node/Folder.php and 1 other location - About 6 hrs to fix
lib/private/Files/Node/Folder.php on lines 173..187

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

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 (!$schema->hasTable("{$prefix}external_config")) {
            $table = $schema->createTable("{$prefix}external_config");
            $table->addColumn('config_id', 'bigint', [
                'autoincrement' => true,
                'notnull' => true,
Severity: Major
Found in core/Migrations/Version20170111103310.php and 1 other location - About 6 hrs to fix
core/Migrations/Version20170111103310.php on lines 117..140

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

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

Share has 44 functions (exceeds 20 allowed). Consider refactoring.
Open

class Share implements IShare {
    /** @var string */
    private $id;
    /** @var string */
    private $providerId;
Severity: Minor
Found in lib/private/Share20/Share.php - About 6 hrs to fix

    Session has 44 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Session implements IUserSession, Emitter {
        use EventEmitterTrait;
        /** @var IUserManager | PublicEmitter $manager */
        private $manager;
    
    
    Severity: Minor
    Found in lib/private/User/Session.php - About 6 hrs to fix

      File ug.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      OC.L10N.register(
          "settings",
          {
          "Wrong current password" : "نۆۋەتتىكى ئىم خاتا",
          "The new password cannot be the same as the previous one" : "يېڭى ئىم ئالدىنقى ئىمغا ئوخشاش بولسا بولمايدۇ",
      Severity: Minor
      Found in settings/l10n/ug.js - About 5 hrs to fix

        File pt_BR.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        OC.L10N.register(
            "settings",
            {
            "Wrong current password" : "Senha atual incorreta",
            "The new password cannot be the same as the previous one" : "A nova senha não pode ser a mesma que a anterior",
        Severity: Minor
        Found in settings/l10n/pt_BR.js - About 5 hrs to fix
          Severity
          Category
          Status
          Source
          Language