owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Function makeTheme has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function makeTheme($themeName, $appTheme = true) {
        $serverRoot = $this->environmentHelper->getServerRoot();
        $baseDirectory = $serverRoot;
        $directory = '';
        $webPath = '';
Severity: Minor
Found in lib/private/Theme/ThemeService.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 delete has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($names) {
        if (!\is_array($names)) {
            $names = [$names];
        }

Severity: Minor
Found in lib/private/Tags.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 groupItems has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function groupItems($items, $itemType) {
        $fileSharing = ($itemType === 'file' || $itemType === 'folder') ? true : false;

        $result = [];

Severity: Minor
Found in lib/private/Share/Share.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 getAppComplains has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function getAppComplains(): array {
        $apps = [];
        $appComplains = $this->config->getAppKeys('core-license-complains');
        foreach ($appComplains as $appComplain) {
            if ($this->config->getAppValue($appComplain, 'enabled', 'no') === 'yes' && $this->appManager->getAppPath($appComplain) !== false) {
Severity: Minor
Found in lib/private/License/LicenseManager.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 formatResult has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) {
        if ($format === self::FORMAT_NONE) {
            return $items;
        } elseif ($format === self::FORMAT_STATUSES) {
            $statuses = [];
Severity: Minor
Found in lib/private/Share/Share.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 createShare has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function createShare(\OCP\Share\IShare $share) {
        $this->canShare($share);

        // Verify if there are any issues with the path
        $this->pathCreateChecks($share->getNode());
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 getShareByToken has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getShareByToken($token) {
        $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);

        try {
            $share = $provider->getShareByToken($token);
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 normalizeVersion has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function normalizeVersion($version, $fullVersion = null) {
        $version = \trim($version);
        if ($fullVersion === null) {
            $fullVersion = $version;
        }
Severity: Minor
Found in lib/private/App/PlatformRepository.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 loadApp has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function loadApp($app, $checkUpgrade = true) {
        self::$loadedApps[] = $app;
        $appPath = self::getAppPath($app);
        if ($appPath === false) {
            return;
Severity: Minor
Found in lib/private/legacy/app.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 needUpgrade has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function needUpgrade(\OCP\IConfig $config) {
        if ($config->getSystemValue('installed', false)) {
            $installedVersion = $config->getSystemValue('version', '0.0.0');
            $currentVersion = \implode('.', \OCP\Util::getVersion());
            $versionDiff = \version_compare($currentVersion, $installedVersion);
Severity: Minor
Found in lib/private/legacy/util.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 loginUser has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private static function loginUser() {
        if (self::$isLoggedIn === true) {
            return \OC_User::getUser();
        }

Severity: Minor
Found in lib/private/legacy/api.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 toXML has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private static function toXML($array, $writer) {
        foreach ($array as $k => $v) {
            if (isset($k[0]) && ($k[0] === '@')) {
                if (\is_array($v)) {
                    foreach ($v as $name => $value) {
Severity: Minor
Found in lib/private/legacy/api.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 execute has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $appSteps = $this->getAppsRepairSteps($output);
        // Handle listing repair steps
        $steps = \array_merge(
            \OC\Repair::getRepairSteps(),
Severity: Minor
Found in core/Command/Maintenance/Repair.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 tryLogin has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function tryLogin($user, $password, $redirect_url, $timezone = null, $remember_login = null) {
        $originalUser = $user;
        // TODO: Add all the insane error handling
        $loginResult = $this->userSession->login($user, $password);
        if ($loginResult !== true && $this->config->getSystemValue('strict_login_enforced', false) !== true) {
Severity: Minor
Found in core/Controller/LoginController.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 _createFileActions has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createFileActions: function() {
        var fileActions = new OCA.Files.FileActions();
        fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
            var dir = context.fileList.getCurrentDirectory();
            context.fileList.changeDirectory(OC.joinPaths(dir, filename));
Severity: Major
Found in apps/files_trashbin/js/app.js - About 2 hrs to fix

    Function _addConvenienceMethods has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _addConvenienceMethods: function (e, data) {
                var that = this,
                    getPromise = function (args) {
                        return $.Deferred().resolveWith(that, args).promise();
                    };
    Severity: Major
    Found in apps/files/js/jquery.fileupload.js - About 2 hrs to fix

      Function updateIcons has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          updateIcons:function(itemType, fileList){
              var item;
              var $fileList;
              var currentDir;
              if (!fileList && OCA.Files) {
      Severity: Major
      Found in core/js/share.js - About 2 hrs to fix

        Method getNodeForPath has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getNodeForPath($path) {
                if (!$this->fileView) {
                    throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
                }
        
        
        Severity: Major
        Found in apps/dav/lib/Connector/Sabre/ObjectTree.php - About 2 hrs to fix

          Method configure has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function configure() {
                  parent::configure();
          
                  $this
                      ->setName('files:scan')
          Severity: Major
          Found in apps/files/lib/Command/Scan.php - About 2 hrs to fix

            File eu.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            OC.L10N.register(
                "core",
                {
                "Please select a file." : "Mesedez, hautatu fitxategia.",
                "File is too big" : "Fitxategia handiegia da",
            Severity: Minor
            Found in core/l10n/eu.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language