owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function findUsersInGroup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function findUsersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
        $group = $this->get($gid);
        if ($group === null) {
            return [];
        }
Severity: Minor
Found in lib/private/Group/Manager.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function displayNamesInGroup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
        $group = $this->get($gid);
        if ($group === null) {
            return [];
        }
Severity: Minor
Found in lib/private/Group/Manager.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function emit_file_hooks_pre has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function emit_file_hooks_pre($exists, $path, &$run) {
        $event = new GenericEvent(null);
        if (!$exists) {
            \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [
                Filesystem::signal_param_path => $this->getHookPath($path),
Severity: Minor
Found in lib/private/Files/View.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function getPath has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPath($id, $includeShares = true) {
        $id = (int)$id;
        $manager = Filesystem::getMountManager();
        $mounts = $manager->findIn($this->fakeRoot);
        $findResult = $manager->find($this->fakeRoot);
Severity: Minor
Found in lib/private/Files/View.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function createSpecificUser has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function createSpecificUser($username, $connection) {
        try {
            //user already specified in config
            $oldUser = $this->config->getSystemValue('dbuser', false);

Severity: Minor
Found in lib/private/Setup/MySQL.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function setupDatabase has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function setupDatabase($username) {
        $e_host = \addslashes($this->dbHost);
        $e_dbname = \addslashes($this->dbName);
        //check if the database user has admin right
        if ($this->dbConnectionString !== null) {
Severity: Minor
Found in lib/private/Setup/OCI.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function load has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function load(array $xmlPath, IUser $user = null) {
        $appManager = $this->getAppManager();
        $allApps = $appManager->getEnabledAppsForUser($user);

        foreach ($allApps as $appId) {
Severity: Minor
Found in lib/private/Server.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function deletePreview has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function deletePreview($keepMax = true) {
        $fileInfo = $this->getFile();
        if ($fileInfo !== null && $fileInfo !== false) {
            if ($keepMax === true) {
                $previewPath = $this->buildCachePath();
Severity: Minor
Found in lib/private/Preview.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function beforeController has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function beforeController($controller, $methodName) {
        // this will set the current navigation entry of the app, use this only
        // for normal HTML requests and not for AJAX requests
        $this->navigationManager->setActiveEntry($this->appName);

Severity: Minor
Found in lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function executeAudited has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function executeAudited($stmt, array $parameters = null) {
        if (\is_string($stmt)) {
            // convert to an array with 'sql'
            if (\stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT
                // TODO try to convert LIMIT OFFSET notation to parameters
Severity: Minor
Found in lib/private/legacy/db.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function adjustStreamChunkSize has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function adjustStreamChunkSize($handle) {
        $stream = $handle;
        $metadata = \stream_get_meta_data($stream);
        while ($metadata['stream_type'] === 'user-space') {
            \stream_set_chunk_size($stream, 64 * 1024);
Severity: Minor
Found in lib/private/legacy/image.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function initTemplateEngine has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function initTemplateEngine($renderAs) {
        if (self::$initTemplateEngineFirstRun) {
            //apps that started before the template initialization can load their own scripts/styles
            //so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true
            //meaning the last script/style in this list will be loaded first
Severity: Minor
Found in lib/private/legacy/template.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function saveTable has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private static function saveTable($table, $xml) {
        $xml->addChild('name', $table->getName());
        $declaration = $xml->addChild('declaration');
        foreach ($table->getColumns() as $column) {
            self::saveColumn($column, $declaration->addChild('field'));
Severity: Minor
Found in lib/private/DB/MDB2SchemaWriter.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function acquireLock has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function acquireLock($path, $type) {
        if (\strlen($path) > 64) { // max length in file_locks
            throw new \InvalidArgumentException("Lock key length too long");
        }
        $expire = $this->getExpireTime();
Severity: Minor
Found in lib/private/Lock/DBLockingProvider.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function execute has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $groupName = $input->getArgument('group');
        $group = $this->groupManager->get($groupName);
        $errorFound = false;
        if (!$group) {
Severity: Minor
Found in core/Command/Group/AddMember.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function execute has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $groupName = $input->getArgument('group');
        $group = $this->groupManager->get($groupName);
        $errorFound = false;
        if (!$group) {
Severity: Minor
Found in core/Command/Group/RemoveMember.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function execute has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $importFile = $input->getArgument('file');
        if ($importFile !== null) {
            $content = $this->getArrayFromFile($importFile);
        } else {
Severity: Minor
Found in core/Command/Config/Import.php - About 1 hr 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 52 locations. Consider refactoring.
Open

OC.L10N.register(
    "federation",
    {
    "Server added to the list of trusted ownClouds" : "Der Server wurde in die Liste der vertrauenswürdigen Server aufgenommen",
    "Server is already in the list of trusted servers." : "Server ist bereits in der Liste der vertrauenswürdigen Servern.",
Severity: Major
Found in apps/federation/l10n/de.js and 51 other locations - About 1 hr to fix
apps/federation/l10n/af_ZA.js on lines 1..16
apps/federation/l10n/ar.js on lines 1..16
apps/federation/l10n/bg_BG.js on lines 1..16
apps/federation/l10n/ca.js on lines 1..16
apps/federation/l10n/cs_CZ.js on lines 1..16
apps/federation/l10n/da.js on lines 1..16
apps/federation/l10n/de_CH.js on lines 1..16
apps/federation/l10n/de_DE.js on lines 1..16
apps/federation/l10n/el.js on lines 1..16
apps/federation/l10n/en_GB.js on lines 1..16
apps/federation/l10n/es.js on lines 1..16
apps/federation/l10n/es_AR.js on lines 1..16
apps/federation/l10n/es_MX.js on lines 1..16
apps/federation/l10n/eu.js on lines 1..16
apps/federation/l10n/fi_FI.js on lines 1..16
apps/federation/l10n/fr.js on lines 1..16
apps/federation/l10n/gl.js on lines 1..16
apps/federation/l10n/he.js on lines 1..16
apps/federation/l10n/hu_HU.js on lines 1..16
apps/federation/l10n/id.js on lines 1..16
apps/federation/l10n/is.js on lines 1..16
apps/federation/l10n/it.js on lines 1..16
apps/federation/l10n/ja.js on lines 1..16
apps/federation/l10n/ko.js on lines 1..16
apps/federation/l10n/lb.js on lines 1..16
apps/federation/l10n/nb_NO.js on lines 1..16
apps/federation/l10n/nl.js on lines 1..16
apps/federation/l10n/nn_NO.js on lines 1..16
apps/federation/l10n/oc.js on lines 1..16
apps/federation/l10n/pl.js on lines 1..16
apps/federation/l10n/pt_BR.js on lines 1..16
apps/federation/l10n/pt_PT.js on lines 1..16
apps/federation/l10n/ro.js on lines 1..16
apps/federation/l10n/ru.js on lines 1..16
apps/federation/l10n/ru_RU.js on lines 1..16
apps/federation/l10n/sl.js on lines 1..16
apps/federation/l10n/sq.js on lines 1..16
apps/federation/l10n/sr.js on lines 1..16
apps/federation/l10n/sv.js on lines 1..16
apps/federation/l10n/th_TH.js on lines 1..16
apps/federation/l10n/tr.js on lines 1..16
apps/federation/l10n/ug.js on lines 1..16
apps/federation/l10n/uk.js on lines 1..16
apps/federation/l10n/zh_CN.js on lines 1..16
apps/federation/l10n/zh_TW.js on lines 1..16
apps/files/l10n/ur_PK.js on lines 1..16
apps/files_external/l10n/ia.js on lines 1..16
apps/files_sharing/l10n/ms_MY.js on lines 1..16
core/l10n/es_ES.js on lines 1..16
core/l10n/gu.js on lines 1..16
lib/l10n/my_MM.js on lines 1..16

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

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

OC.L10N.register(
    "federation",
    {
    "Server added to the list of trusted ownClouds" : "Server aggiunto all'elenco di ownCloud affidabili",
    "Server is already in the list of trusted servers." : "Il server è già nell'elenco dei server affidabili.",
Severity: Major
Found in apps/federation/l10n/it.js and 51 other locations - About 1 hr to fix
apps/federation/l10n/af_ZA.js on lines 1..16
apps/federation/l10n/ar.js on lines 1..16
apps/federation/l10n/bg_BG.js on lines 1..16
apps/federation/l10n/ca.js on lines 1..16
apps/federation/l10n/cs_CZ.js on lines 1..16
apps/federation/l10n/da.js on lines 1..16
apps/federation/l10n/de.js on lines 1..16
apps/federation/l10n/de_CH.js on lines 1..16
apps/federation/l10n/de_DE.js on lines 1..16
apps/federation/l10n/el.js on lines 1..16
apps/federation/l10n/en_GB.js on lines 1..16
apps/federation/l10n/es.js on lines 1..16
apps/federation/l10n/es_AR.js on lines 1..16
apps/federation/l10n/es_MX.js on lines 1..16
apps/federation/l10n/eu.js on lines 1..16
apps/federation/l10n/fi_FI.js on lines 1..16
apps/federation/l10n/fr.js on lines 1..16
apps/federation/l10n/gl.js on lines 1..16
apps/federation/l10n/he.js on lines 1..16
apps/federation/l10n/hu_HU.js on lines 1..16
apps/federation/l10n/id.js on lines 1..16
apps/federation/l10n/is.js on lines 1..16
apps/federation/l10n/ja.js on lines 1..16
apps/federation/l10n/ko.js on lines 1..16
apps/federation/l10n/lb.js on lines 1..16
apps/federation/l10n/nb_NO.js on lines 1..16
apps/federation/l10n/nl.js on lines 1..16
apps/federation/l10n/nn_NO.js on lines 1..16
apps/federation/l10n/oc.js on lines 1..16
apps/federation/l10n/pl.js on lines 1..16
apps/federation/l10n/pt_BR.js on lines 1..16
apps/federation/l10n/pt_PT.js on lines 1..16
apps/federation/l10n/ro.js on lines 1..16
apps/federation/l10n/ru.js on lines 1..16
apps/federation/l10n/ru_RU.js on lines 1..16
apps/federation/l10n/sl.js on lines 1..16
apps/federation/l10n/sq.js on lines 1..16
apps/federation/l10n/sr.js on lines 1..16
apps/federation/l10n/sv.js on lines 1..16
apps/federation/l10n/th_TH.js on lines 1..16
apps/federation/l10n/tr.js on lines 1..16
apps/federation/l10n/ug.js on lines 1..16
apps/federation/l10n/uk.js on lines 1..16
apps/federation/l10n/zh_CN.js on lines 1..16
apps/federation/l10n/zh_TW.js on lines 1..16
apps/files/l10n/ur_PK.js on lines 1..16
apps/files_external/l10n/ia.js on lines 1..16
apps/files_sharing/l10n/ms_MY.js on lines 1..16
core/l10n/es_ES.js on lines 1..16
core/l10n/gu.js on lines 1..16
lib/l10n/my_MM.js on lines 1..16

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

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

OC.L10N.register(
    "federation",
    {
    "Server added to the list of trusted ownClouds" : "Þjóninum bætt við listann yfir treyst ownCloud-ský",
    "Server is already in the list of trusted servers." : "Þjónninn er nú þegar á listanum yfir treysta þjóna.",
Severity: Major
Found in apps/federation/l10n/is.js and 51 other locations - About 1 hr to fix
apps/federation/l10n/af_ZA.js on lines 1..16
apps/federation/l10n/ar.js on lines 1..16
apps/federation/l10n/bg_BG.js on lines 1..16
apps/federation/l10n/ca.js on lines 1..16
apps/federation/l10n/cs_CZ.js on lines 1..16
apps/federation/l10n/da.js on lines 1..16
apps/federation/l10n/de.js on lines 1..16
apps/federation/l10n/de_CH.js on lines 1..16
apps/federation/l10n/de_DE.js on lines 1..16
apps/federation/l10n/el.js on lines 1..16
apps/federation/l10n/en_GB.js on lines 1..16
apps/federation/l10n/es.js on lines 1..16
apps/federation/l10n/es_AR.js on lines 1..16
apps/federation/l10n/es_MX.js on lines 1..16
apps/federation/l10n/eu.js on lines 1..16
apps/federation/l10n/fi_FI.js on lines 1..16
apps/federation/l10n/fr.js on lines 1..16
apps/federation/l10n/gl.js on lines 1..16
apps/federation/l10n/he.js on lines 1..16
apps/federation/l10n/hu_HU.js on lines 1..16
apps/federation/l10n/id.js on lines 1..16
apps/federation/l10n/it.js on lines 1..16
apps/federation/l10n/ja.js on lines 1..16
apps/federation/l10n/ko.js on lines 1..16
apps/federation/l10n/lb.js on lines 1..16
apps/federation/l10n/nb_NO.js on lines 1..16
apps/federation/l10n/nl.js on lines 1..16
apps/federation/l10n/nn_NO.js on lines 1..16
apps/federation/l10n/oc.js on lines 1..16
apps/federation/l10n/pl.js on lines 1..16
apps/federation/l10n/pt_BR.js on lines 1..16
apps/federation/l10n/pt_PT.js on lines 1..16
apps/federation/l10n/ro.js on lines 1..16
apps/federation/l10n/ru.js on lines 1..16
apps/federation/l10n/ru_RU.js on lines 1..16
apps/federation/l10n/sl.js on lines 1..16
apps/federation/l10n/sq.js on lines 1..16
apps/federation/l10n/sr.js on lines 1..16
apps/federation/l10n/sv.js on lines 1..16
apps/federation/l10n/th_TH.js on lines 1..16
apps/federation/l10n/tr.js on lines 1..16
apps/federation/l10n/ug.js on lines 1..16
apps/federation/l10n/uk.js on lines 1..16
apps/federation/l10n/zh_CN.js on lines 1..16
apps/federation/l10n/zh_TW.js on lines 1..16
apps/files/l10n/ur_PK.js on lines 1..16
apps/files_external/l10n/ia.js on lines 1..16
apps/files_sharing/l10n/ms_MY.js on lines 1..16
core/l10n/es_ES.js on lines 1..16
core/l10n/gu.js on lines 1..16
lib/l10n/my_MM.js on lines 1..16

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

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

Severity
Category
Status
Source
Language