owncloud/core

View on GitHub

Showing 4,503 of 4,503 total issues

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

OC.L10N.register(
    "settings",
    {
    "Couldn't send reset email. Please contact your administrator." : "Non poteva inviar le message de reinitialisation. Per favor contacta tu administrator.",
    "Saved" : "Salveguardate",
Severity: Major
Found in settings/l10n/ia.js and 1 other location - About 1 day to fix
apps/files_external/l10n/es_AR.js on lines 1..50

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

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

OC.L10N.register(
    "files_external",
    {
    "Step 1 failed. Exception: %s" : "Error en paso 1. Excepción: %s",
    "Step 2 failed. Exception: %s" : "Error en paso 2. Excepción: %s",
Severity: Major
Found in apps/files_external/l10n/es_AR.js and 1 other location - About 1 day to fix
settings/l10n/ia.js on lines 1..50

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

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

File CardDavBackend.php has 591 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
 * @author Björn Schießle <bjoern@schiessle.org>
 * @author Georg Ehrke <georg@owncloud.com>
Severity: Major
Found in apps/dav/lib/CardDAV/CardDavBackend.php - About 1 day to fix

    Manager has 69 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Manager implements IManager {
        /** @var IProviderFactory */
        private $factory;
        /** @var ILogger */
        private $logger;
    Severity: Major
    Found in lib/private/Share20/Manager.php - About 1 day to fix

      Function basicOperation has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
      Open

          private function basicOperation($operation, $path, $hooks = [], $extraParam = null) {
              $postFix = (\substr($path, -1, 1) === '/') ? '/' : '';
              $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
              if (Filesystem::isValidPath($path)
                  and !Filesystem::isForbiddenFileOrDir($path)
      Severity: Minor
      Found in lib/private/Files/View.php - About 1 day 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 checkServer has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function checkServer(\OCP\IConfig $config) {
              $l = \OC::$server->getL10N('lib');
              $errors = [];
              $CONFIG_DATADIRECTORY = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data');
      
      
      Severity: Minor
      Found in lib/private/legacy/util.php - About 1 day 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

      File client.js has 583 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Copyright (c) 2015
       *
       * This file is licensed under the Affero General Public License version 3
       * or later.
      Severity: Major
      Found in core/js/files/client.js - About 1 day to fix

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

        OC.L10N.register(
            "files_external",
            {
            "Step 1 failed. Exception: %s" : "Stap 1 het misluk. Uitsondering: %s",
            "Step 2 failed. Exception: %s" : "Stap 2 het misluk. Uitsondering: %s",
        Severity: Major
        Found in apps/files_external/l10n/af_ZA.js and 2 other locations - About 1 day to fix
        core/l10n/es_CL.js on lines 1..47
        settings/l10n/si.js on lines 1..47

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

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

        OC.L10N.register(
            "core",
            {
            "Unknown filetype" : "Tipo de archivo desconocido",
            "Invalid image" : "Imagen no válida",
        Severity: Major
        Found in core/l10n/es_CL.js and 2 other locations - About 1 day to fix
        apps/files_external/l10n/af_ZA.js on lines 1..47
        settings/l10n/si.js on lines 1..47

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

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

        OC.L10N.register(
            "settings",
            {
            "Authentication error" : "සත්‍යාපන දෝෂයක්",
            "Saved" : "සුරැකිණි",
        Severity: Major
        Found in settings/l10n/si.js and 2 other locations - About 1 day to fix
        apps/files_external/l10n/af_ZA.js on lines 1..47
        core/l10n/es_CL.js on lines 1..47

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

        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 _generateHTML has 240 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.datepicker._generateHTML = function( inst ) {
                var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
                    controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
                    monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
                    selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
        Severity: Major
        Found in core/js/js.js - About 1 day to fix

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

              initSharingOut: function($el) {
                  if (this._outFileList) {
                      return this._outFileList;
                  }
          
          
          Severity: Major
          Found in apps/files_sharing/js/app.js and 1 other location - About 1 day to fix
          apps/files_sharing/js/app.js on lines 81..106

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

          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

              initSharingLinks: function($el) {
                  if (this._linkFileList) {
                      return this._linkFileList;
                  }
          
          
          Severity: Major
          Found in apps/files_sharing/js/app.js and 1 other location - About 1 day to fix
          apps/files_sharing/js/app.js on lines 54..79

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

          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

          OC.L10N.register(
              "lib",
              {
              "Cannot write into \"config\" directory!" : "\"configurasiya\" direktoriyasının daxilində yazmaq mümkün deyil",
              "This can usually be fixed by giving the webserver write access to the config directory" : "Adətən tez həll etmək üçün WEB serverdə yazma yetkisi verilir",
          Severity: Major
          Found in lib/l10n/az.js and 1 other location - About 1 day to fix
          core/l10n/pa.js on lines 1..46

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

          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

          OC.L10N.register(
              "core",
              {
              "Sunday" : "ਐਤਵਾਰ",
              "Monday" : "ਸੋਮਵਾਰ",
          Severity: Major
          Found in core/l10n/pa.js and 1 other location - About 1 day to fix
          lib/l10n/az.js on lines 1..46

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

          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

          File admin-apps.js has 555 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* global Handlebars */
          
          Handlebars.registerHelper('score', function() {
              if(this.score) {
                  var score = Math.round( this.score / 10 );
          Severity: Major
          Found in settings/js/admin-apps.js - About 1 day to fix

            Function fileexists has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
            Open

                fileexists:function(data, original, replacement, controller) {
                    var self = this;
                    var dialogDeferred = new $.Deferred();
            
                    var getCroppedPreview = function(file) {
            Severity: Minor
            Found in core/js/oc-dialogs.js - About 1 day 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 4 locations. Consider refactoring.
            Open

            OC.L10N.register(
                "files_external",
                {
                "Step 1 failed. Exception: %s" : "Korak 1 nije uspeo. Izuzetak: %s",
                "Step 2 failed. Exception: %s" : "Korak 2 nije uspeo. Izuzetak: %s",
            Severity: Major
            Found in apps/files_external/l10n/sr@latin.js and 3 other locations - About 1 day to fix
            apps/files_external/l10n/lt_LT.js on lines 1..45
            core/l10n/te.js on lines 1..45
            settings/l10n/sr@latin.js on lines 1..45

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

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

            OC.L10N.register(
                "core",
                {
                "Sunday" : "ఆదివారం",
                "Monday" : "సోమవారం",
            Severity: Major
            Found in core/l10n/te.js and 3 other locations - About 1 day to fix
            apps/files_external/l10n/lt_LT.js on lines 1..45
            apps/files_external/l10n/sr@latin.js on lines 1..45
            settings/l10n/sr@latin.js on lines 1..45

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

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

            OC.L10N.register(
                "files_external",
                {
                "Step 1 failed. Exception: %s" : "1 žingsnio klaida: %s",
                "Step 2 failed. Exception: %s" : "2 žingsnio klaida: %s",
            Severity: Major
            Found in apps/files_external/l10n/lt_LT.js and 3 other locations - About 1 day to fix
            apps/files_external/l10n/sr@latin.js on lines 1..45
            core/l10n/te.js on lines 1..45
            settings/l10n/sr@latin.js on lines 1..45

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

            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