owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function editUser has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function editUser($parameters) {
        /** @var string $targetUserId */
        $targetUserId = $parameters['userid'];

        // Check if user is logged in
Severity: Minor
Found in apps/provisioning_api/lib/Users.php - About 5 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

Function init has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public static function init() {
        // calculate the root directories
        OC::$SERVERROOT = \str_replace("\\", '/', \substr(__DIR__, 0, -4));

        // register autoloader
Severity: Minor
Found in lib/kernel.php - About 5 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

Function process has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(bool $all = false, int $chunkSize = 1000, \Closure $progress = null): int {
        $root = \OC::$server->getLazyRootFolder();
        $count = 0;

        $qb = $this->connection->getQueryBuilder();
Severity: Minor
Found in lib/private/PreviewCleanup.php - About 5 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

Function getShippedApps has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function getShippedApps() {
        $shippedApps = [];
        foreach (\OC::$APPSROOTS as $app_dir) {
            if ($dir = \opendir($app_dir['path'])) {
                $nodes = \scandir($app_dir['path']);
Severity: Minor
Found in lib/private/Installer.php - About 5 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

Function loadApps has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public static function loadApps($types = null) {
        if (\is_array($types) && !\array_diff($types, self::$loadedTypes)) {
            return true;
        }
        if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
Severity: Minor
Found in lib/private/legacy/app.php - About 5 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

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

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $username = $input->getArgument('user');
        $emailLink = $input->getOption('send-email');
        $displayLink = $input->getOption('output-link');

Severity: Minor
Found in core/Command/User/ResetPassword.php - About 5 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

File de_CH.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
Open

OC.L10N.register(
    "settings",
    {
    "Wrong current password" : "Das aktuelle Passwort ist falsch.",
    "The new password cannot be the same as the previous one" : "Das neue Passwort kann nicht identisch zum alten Passwort sein.",
Severity: Minor
Found in settings/l10n/de_CH.js - About 5 hrs to fix

    File Manager.php has 385 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @author Björn Schießle <bjoern@schiessle.org>
     * @author Joas Schilling <coding@schilljs.com>
     * @author Jörn Friedrich Dreyer <jfd@butonic.de>
    Severity: Minor
    Found in apps/files_sharing/lib/External/Manager.php - About 5 hrs to fix

      File Setup.php has 382 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Administrator <Administrator@WINDOWS-2012>
       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
       * @author Bart Visscher <bartv@thisnet.nl>
      Severity: Minor
      Found in lib/private/Setup.php - About 5 hrs to fix

        OC has 39 functions (exceeds 20 allowed). Consider refactoring.
        Open

        var OC = {
            PERMISSION_CREATE: 4,
            PERMISSION_READ: 1,
            PERMISSION_UPDATE: 2,
            PERMISSION_DELETE: 8,
        Severity: Minor
        Found in core/js/js.js - About 5 hrs to fix

          Encoding has 39 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Encoding extends Wrapper {
              /**
               * @var CappedMemoryCache
               */
              private $namesCache;
          Severity: Minor
          Found in lib/private/Files/Storage/Wrapper/Encoding.php - About 5 hrs to fix

            Availability has 39 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Availability extends Wrapper {
                public const RECHECK_TTL_SEC = 600; // 10 minutes
            
                public static function shouldRecheck($availability) {
                    if (!$availability['available']) {
            Severity: Minor
            Found in lib/private/Files/Storage/Wrapper/Availability.php - About 5 hrs to fix

              File de.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              OC.L10N.register(
                  "core",
                  {
                  "Please select a file." : "Bitte wähle eine Datei aus.",
                  "File is too big" : "Datei ist zu groß",
              Severity: Minor
              Found in core/l10n/de.js - About 5 hrs to fix

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

                OC.L10N.register(
                    "core",
                    {
                    "Please select a file." : "Por favor selecione um arquivo.",
                    "File is too big" : "O arquivo é muito grande",
                Severity: Minor
                Found in core/l10n/pt_BR.js - About 5 hrs to fix

                  File en_GB.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  OC.L10N.register(
                      "core",
                      {
                      "Please select a file." : "Please select a file.",
                      "File is too big" : "File is too big",
                  Severity: Minor
                  Found in core/l10n/en_GB.js - About 5 hrs to fix

                    File sq.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    OC.L10N.register(
                        "core",
                        {
                        "Please select a file." : "Ju lutemi, përzgjidhni një kartelë.",
                        "File is too big" : "Kartela është shumë e madhe",
                    Severity: Minor
                    Found in core/l10n/sq.js - About 5 hrs to fix

                      File sharedfilelist.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                       * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
                       *
                       * This file is licensed under the Affero General Public License version 3
                       * or later.
                      Severity: Minor
                      Found in apps/files_sharing/js/sharedfilelist.js - About 5 hrs to fix

                        File ko.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        OC.L10N.register(
                            "core",
                            {
                            "Please select a file." : "파일을 선택하십시오.",
                            "File is too big" : "파일이 너무 큼",
                        Severity: Minor
                        Found in core/l10n/ko.js - About 5 hrs to fix

                          File de_DE.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          OC.L10N.register(
                              "core",
                              {
                              "Please select a file." : "Bitte wählen Sie eine Datei aus.",
                              "File is too big" : "Datei ist zu groß.",
                          Severity: Minor
                          Found in core/l10n/de_DE.js - About 5 hrs to fix

                            File sv.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            OC.L10N.register(
                                "core",
                                {
                                "Please select a file." : "Vänligen välj en fil.",
                                "File is too big" : "Filen är för stor",
                            Severity: Minor
                            Found in core/l10n/sv.js - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language