owncloud/core

View on GitHub

Showing 3,230 of 4,482 total issues

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

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $output->writeln('<info>This feature is currently experimental.</info>');
        $this->targetType = $this->connectionFactory->normalizeType($input->getArgument('type'));
        $this->targetHostname = $input->getArgument('hostname');
        $this->targetPort = $input->getOption('port');
Severity: Minor
Found in core/Command/Db/ConvertType.php - About 25 mins 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 prepareParentFolder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function prepareParentFolder($path) {
        $path = Filesystem::normalizePath($path);
        // If the file resides within a subdirectory, create it
        if ($this->rootView->file_exists($path) === false) {
            $sub_dirs = \explode('/', \ltrim($path, '/'));
Severity: Minor
Found in core/Command/Encryption/ChangeKeyStorageRoot.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $configNames = $input->getArgument('name');
        $configName = $configNames[0];
        $configValue = $this->castValue($input->getOption('value'), $input->getOption('type'));
        $updateOnly = $input->getOption('update-only');
Severity: Minor
Found in core/Command/Config/System/SetConfig.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $outputType = $input->getOption('output');
        if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) {
            $certificates = \array_map(function (ICertificate $certificate) {
                return [
Severity: Minor
Found in core/Command/Security/ListCertificates.php - About 25 mins 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 getSystemConfigs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getSystemConfigs($noSensitiveValues) {
        $keys = $this->systemConfig->getKeys();

        $configs = [];
        foreach ($keys as $key) {
Severity: Minor
Found in core/Command/Config/ListConfigs.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        if ($input->getOption('on')) {
            $this->config->setSystemValue('maintenance', true);
            $output->writeln('Maintenance mode enabled');
            $output->writeln('Please also consider to stop the web server on all ownCloud instances');
Severity: Minor
Found in core/Command/Maintenance/Mode.php - About 25 mins 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 checkPerson has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPerson($login, $password) {
        if ($login && $password) {
            $user = $this->userManager->checkPassword($login, $password);
            if ($user !== false) {
                $xml = [];
Severity: Minor
Found in core/Controller/OcsController.php - About 25 mins 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 email has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function email($user) {
        try {
            $userObject = $this->userManager->get($user);
            if ($userObject === null) {
                $users = $this->userManager->getByEmail($user);
Severity: Minor
Found in core/Controller/LostController.php - About 25 mins 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 new has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function new(?string $parent_container_id, ?string $filename): DataResponse {
        $userAgent = $this->request->getHeader('User-Agent') ?? '-';
        $this->logger->info("new($parent_container_id, $filename) - $userAgent");

        if ($parent_container_id === null) {
Severity: Minor
Found in core/Controller/AppRegistryController.php - About 25 mins 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 getDefaultApp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getDefaultApp(string $mimeType): ?string {
        # get mime from file and see which of the enabled apps matches
        foreach (self::$apps as $app_name => $app_info) {
            $oc_app_name = $app_info['oc_app_name'];
            if ($this->appManager->isEnabledForUser($oc_app_name)) {
Severity: Minor
Found in core/Controller/AppRegistryController.php - About 25 mins 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

Severity
Category
Status
Source
Language