owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method execute has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $outputType = $input->getOption('output');

        \OC_App::loadApps();
        $this->router->loadRoutes();
Severity: Major
Found in core/Command/Security/ListRoutes.php - About 2 hrs to fix

    Method execute has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output): int {
            $appNameSubString = $input->getArgument('search-pattern');
            $minimalView = $input->getOption('minimal');
    
            if ($input->getOption('shipped') === 'true' || $input->getOption('shipped') === 'false') {
    Severity: Major
    Found in core/Command/App/ListApps.php - About 2 hrs to fix

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

      <?php
      /**
       * @author Andreas Fischer <bantu@owncloud.com>
       * @author Bart Visscher <bartv@thisnet.nl>
       * @author Jörn Friedrich Dreyer <jfd@butonic.de>
      Severity: Minor
      Found in lib/private/legacy/response.php - About 2 hrs to fix

        Function setupGroupsSelect has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            setupGroupsSelect: function($elements, extraOptions, options) {
                var self = this;
                options = options || {};
                if ($elements.length > 0) {
                    // note: settings are saved through a "change" event registered
        Severity: Minor
        Found in settings/js/settings.js - About 2 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 alphanum has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            alphanum: function(a, b) {
                function chunkify(t) {
                    var tz = [], x = 0, y = -1, n = 0, i, j;
        
                    while (i = (j = t.charAt(x++)).charCodeAt(0)) {
        Severity: Minor
        Found in settings/js/users/users.js - About 2 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 tipsy has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        jQuery.fn.tipsy = function (argument) {
            console.warn('Deprecation warning: tipsy is deprecated. Use tooltip instead.');
            if (typeof argument === 'object' && argument !== null) {
        
                // tipsy defaults
        Severity: Minor
        Found in core/js/js.js - About 2 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 getResponse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            getResponse: function() {
                var response = this.data.response();
                if (response.errorThrown) {
                    if (response.errorThrown === 'timeout') {
                        return {
        Severity: Minor
        Found in apps/files/js/file-upload.js - About 2 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 getSharedWithMe has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getSharedWithMe($node, $includeTags, $requestedShareTypes, $stateFilter = 0) {
                // sharedWithMe is limited to user and group shares for compatibility.
                $shares = [];
                if (isset($requestedShareTypes[Share::SHARE_TYPE_USER]) && $requestedShareTypes[Share::SHARE_TYPE_USER]) {
                    $shares = \array_merge(
        Severity: Minor
        Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 2 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 showShare has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function showShare($token, $path = '') {
                \OC_User::setIncognitoMode(true);
        
                // Check whether share exists
                try {
        Severity: Minor
        Found in apps/files_sharing/lib/Controllers/ShareController.php - About 2 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 handleGetProperties has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function handleGetProperties(
                PropFind $propFind,
                \Sabre\DAV\INode $node
            ) {
                if (!($node instanceof File) && !($node instanceof Directory)) {
        Severity: Minor
        Found in apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php - About 2 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 findInvalidReshareInitiator has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            private function findInvalidReshareInitiator(InputInterface $input, OutputInterface $output, $fix, $scopeUid) {
                $output->writeln([
                    "<info>==========================</info>",
                    "<info>Searching for reshares that have invalid uid_initiator(resharer), meaning resharer which does not have the received share mounted anymore (that he reshared with other user).</info>",
                    "<info>==========================</info>",
        Severity: Minor
        Found in apps/files/lib/Command/TroubleshootTransferOwnership.php - About 2 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 propfind has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function propfind($path, $strictNotFoundCheck=false) {
                $path = $this->cleanPath($path);
                $cachedResponse = $this->statCache->get($path);
                // we either don't know it, or we know it exists but need more details
                if ($cachedResponse === null || $cachedResponse === true) {
        Severity: Minor
        Found in lib/private/Files/Storage/DAV.php - About 2 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 hasUpdated has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function hasUpdated($path, $time) {
                $this->init();
                $path = $this->cleanPath($path);
                try {
                    // force refresh for $path
        Severity: Minor
        Found in lib/private/Files/Storage/DAV.php - About 2 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 deleteAllMountsForUser has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function deleteAllMountsForUser(IUser $user) {
                $getUserMounts = $this->userMountCache->getMountsForUser($user);
                $allMounts = $this->dbConfig->getAllMounts();
                $result = false;
                if (\count($getUserMounts) > 0) {
        Severity: Minor
        Found in lib/private/Files/External/Service/UserStoragesService.php - About 2 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 validateExpirationDate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function validateExpirationDate(\OCP\Share\IShare $share, $skipPastDateValidation = false) {
                $expirationDate = $share->getExpirationDate();
        
                if ($expirationDate !== null) {
                    // Set the expiration date to just the date at "zero" time in the day
        Severity: Minor
        Found in lib/private/Share20/Manager.php - About 2 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 copyTable has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function copyTable(Connection $fromDB, Connection $toDB, Table $table, InputInterface $input, OutputInterface $output) {
                $tableName = $table->getName();
                $chunkSize = $input->getOption('chunk-size');
        
                $progress = new ProgressBar($output);
        Severity: Minor
        Found in core/Command/Db/ConvertType.php - About 2 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 _attachments has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.datepicker._attachments = function (input, inst) {
                var showOn, buttonText, buttonImage,
                    appendText = this._get(inst, "appendText"),
                    isRTL = this._get(inst, "isRTL");
        
        
        Severity: Major
        Found in core/js/js.js - About 2 hrs to fix

          Method getGroups has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function getGroups($search) {
                  $this->result['groups'] = $this->result['exact']['groups'] = [];
          
                  if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
                      $this->result['groups'] = [];
          Severity: Major
          Found in apps/files_sharing/lib/Controller/ShareesController.php - About 2 hrs to fix

            Method execute has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output): int {
                    $user = $input->getOption('user');
                    $mountPoint = $input->getArgument('mount_point');
                    $storageIdentifier = $input->getArgument('storage_backend');
                    $authIdentifier = $input->getArgument('authentication_backend');
            Severity: Major
            Found in apps/files_external/lib/Command/Create.php - About 2 hrs to fix

              Method fopen has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function fopen($path, $mode) {
                      $this->log('enter: '.__FUNCTION__."($path, $mode)");
                      $fullPath = $this->buildPath($path);
                      $result = false;
                      try {
              Severity: Major
              Found in apps/files_external/lib/Lib/Storage/SMB.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language