owncloud/core

View on GitHub

Showing 3,230 of 4,482 total issues

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

    Function updateIcons has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        updateIcons:function(itemType, fileList){
            var item;
            var $fileList;
            var currentDir;
            if (!fileList && OCA.Files) {
    Severity: Minor
    Found in core/js/share.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

    File Tags.php has 535 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @author Bernhard Reiter <ockham@raz.or.at>
     * @author derkostka <sebastian.kostka@gmail.com>
     * @author Joas Schilling <coding@schilljs.com>
    Severity: Major
    Found in lib/private/Tags.php - About 1 day to fix

      Common has 61 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class Common implements Storage, ILockingStorage, IVersionedStorage, IPersistentLockingStorage {
          use LocalTempFileTrait;
      
          protected $cache;
          protected $scanner;
      Severity: Major
      Found in lib/private/Files/Storage/Common.php - About 1 day to fix

        Method __construct has 219 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __construct(array $urlParams=[]) {
                parent::__construct('settings', $urlParams);
        
                $container = $this->getContainer();
        
        
        Severity: Major
        Found in settings/Application.php - About 1 day to fix

          File Filesystem.php has 530 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
           * @author Bart Visscher <bartv@thisnet.nl>
           * @author Christopher Schäpers <kondou@ts.unde.re>
          Severity: Major
          Found in lib/private/Files/Filesystem.php - About 1 day to fix

            LazyRoot has 60 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class LazyRoot implements IRootFolder {
                /** @var \Closure */
                private $rootFolderClosure;
            
                /** @var IRootFolder */
            Severity: Major
            Found in lib/private/Files/Node/LazyRoot.php - About 1 day to fix

              File sharedialogview.js has 526 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/sharedialogview.js - About 1 day to fix

                Function fopen has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function fopen($path, $mode) {
                        // check if the file is stored in the array cache, this means that we
                        // copy a file over to the versions folder, in this case we don't want to
                        // decrypt it
                        if ($this->arrayCache->hasKey('encryption_copy_version_' . $path)) {
                Severity: Minor
                Found in lib/private/Files/Storage/Wrapper/Encryption.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

                Method put has 210 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function put(
                        $itemType,
                        $itemSource,
                        $shareType,
                        $shareWith,
                Severity: Major
                Found in lib/private/Share/Share.php - About 1 day to fix

                  Wrapper has 58 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IPersistentLockingStorage {
                      /**
                       * @var \OC\Files\Storage\Storage $storage
                       */
                      protected $storage;
                  Severity: Major
                  Found in lib/private/Files/Storage/Wrapper/Wrapper.php - About 1 day to fix

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

                    <?php
                    /**
                     * @author Bart Visscher <bartv@thisnet.nl>
                     * @author Björn Schießle <bjoern@schiessle.org>
                     * @author Jakob Sack <mail@jakobsack.de>
                    Severity: Major
                    Found in apps/dav/lib/Connector/Sabre/File.php - About 1 day to fix

                      Function initCore has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function initCore() {
                          // setup tooltip
                          $('.section .icon-info').tooltip({placement: 'right'});
                      
                          /**
                      Severity: Minor
                      Found in core/js/js.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

                      File Common.php has 510 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                       * @author Bart Visscher <bartv@thisnet.nl>
                       * @author Björn Schießle <bjoern@schiessle.org>
                      Severity: Major
                      Found in lib/private/Files/Storage/Common.php - About 1 day to fix

                        Method __construct has 203 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __construct(IRequest $request, $baseUri) {
                                $this->request = $request;
                                $this->baseUri = $baseUri;
                                $logger = OC::$server->getLogger();
                                $dispatcher = OC::$server->getEventDispatcher();
                        Severity: Major
                        Found in apps/dav/lib/Server.php - About 1 day to fix

                          Function put has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private static function put(
                                  $itemType,
                                  $itemSource,
                                  $shareType,
                                  $shareWith,
                          Severity: Minor
                          Found in lib/private/Share/Share.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 listAllApps has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function listAllApps(bool $listEveryApp = false) {
                                  $installedApps = OC_App::getAllApps();
                          
                                  //TODO which apps do we want to blacklist and how do we integrate
                                  // blacklisting with the multi apps folder feature?
                          Severity: Minor
                          Found in lib/private/legacy/app.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

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

                          class Share extends Constants {
                              /** CRUDS permissions (Create, Read, Update, Delete, Share) using a bitmask
                               * Construct permissions for share() and setPermissions with Or (|) e.g.
                               * Give user read and update permissions: PERMISSION_READ | PERMISSION_UPDATE
                               *
                          Severity: Major
                          Found in lib/private/Share/Share.php - About 1 day to fix

                            File fileactions.js has 499 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*
                             * Copyright (c) 2014
                             *
                             * This file is licensed under the Affero General Public License version 3
                             * or later.
                            Severity: Minor
                            Found in apps/files/js/fileactions.js - About 1 day to fix
                              Severity
                              Category
                              Status
                              Source
                              Language