Skip to content

fix: SonarCloud issues

c72a6c3
Select commit
Loading
Failed to load commit list.
Open

fix(discovery): check quota before upload (during discovery) #9777

fix: SonarCloud issues
c72a6c3
Select commit
Loading
Failed to load commit list.
SonarQubeCloud / SonarCloud Code Analysis failed Apr 3, 2026 in 19m 19s

Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)
104 New Code Smells (required ≤ 0)
D Maintainability Rating on New Code (required ≥ A)
1 New Bugs (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Annotations

Check warning on line 2161 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace with the version of "std::ranges::find_if" that takes a range.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfut&open=AZ1Sm6RDWzwQiKxZVfut&pullRequest=9777

Check warning on line 1605 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Avoid this unnecessary copy by using a "const" reference.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVft9&open=AZ1Sm6KiWzwQiKxZVft9&pullRequest=9777

Check warning on line 773 in src/libsync/propagateupload.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

implicit conversion from 'qint64' (aka 'long long') to 'double' may lose precision

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6VQWzwQiKxZVfu_&open=AZ1Sm6VQWzwQiKxZVfu_&pullRequest=9777

Check warning on line 1353 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace this loop with a "std::erase_if" call.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVft5&open=AZ1Sm6KiWzwQiKxZVft5&pullRequest=9777

Check warning on line 63 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Unmodified variable "basePinState" of type "enum OCC::PinState" should be const-qualified.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfuH&open=AZ1Sm6RDWzwQiKxZVfuH&pullRequest=9777

Check warning on line 1259 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Remove the redundant return type of this lambda.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVft1&open=AZ1Sm6KiWzwQiKxZVft1&pullRequest=9777

Check warning on line 431 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Reduce this switch case number of lines from 6 to at most 5, for example by extracting code into methods.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfuS&open=AZ1Sm6RDWzwQiKxZVfuS&pullRequest=9777

Check failure on line 386 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this code to not nest more than 3 if|for|do|while|switch statements.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVfth&open=AZ1Sm6KiWzwQiKxZVfth&pullRequest=9777

Check warning on line 1259 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Unmodified variable "cancel" of type "_Bool" should be const-qualified.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVft2&open=AZ1Sm6KiWzwQiKxZVft2&pullRequest=9777

Check failure on line 1184 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 33 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVftw&open=AZ1Sm6KiWzwQiKxZVftw&pullRequest=9777

Check warning on line 641 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use the init-statement to declare "excludeFilePath" inside the if statement.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVftk&open=AZ1Sm6KiWzwQiKxZVftk&pullRequest=9777

Check failure on line 248 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace the use of "new" with an operation that automatically manages the memory.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVftg&open=AZ1Sm6KiWzwQiKxZVftg&pullRequest=9777

Check warning on line 874 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Extract this nested code block into a separate function.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVftq&open=AZ1Sm6KiWzwQiKxZVftq&pullRequest=9777

Check warning on line 411 in src/libsync/syncengine.h

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Rename this identifier to be shorter or equal to 31 characters.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1TUfU_V80h1Qdmofdz&open=AZ1TUfU_V80h1Qdmofdz&pullRequest=9777

Check failure on line 1217 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

"std::forward" is never called on this forwarding reference argument.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVftz&open=AZ1Sm6KiWzwQiKxZVftz&pullRequest=9777

Check warning on line 31 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use "std::array" or "std::vector" instead of a C-style array.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RCWzwQiKxZVfuB&open=AZ1Sm6RCWzwQiKxZVfuB&pullRequest=9777

Check failure on line 508 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this code to not nest more than 3 if|for|do|while|switch statements.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVftl&open=AZ1Sm6KiWzwQiKxZVftl&pullRequest=9777

Check failure on line 2311 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 27 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfux&open=AZ1Sm6RDWzwQiKxZVfux&pullRequest=9777

Check warning on line 459 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Reduce this switch case number of lines from 20 to at most 5, for example by extracting code into methods.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfuR&open=AZ1Sm6RDWzwQiKxZVfuR&pullRequest=9777

Check warning on line 2163 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use the init-statement to declare "isMatchingFileExtension" inside the if statement.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfus&open=AZ1Sm6RDWzwQiKxZVfus&pullRequest=9777

Check warning on line 1309 in src/libsync/syncengine.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Rename this identifier to be shorter or equal to 31 characters.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6KiWzwQiKxZVft3&open=AZ1Sm6KiWzwQiKxZVft3&pullRequest=9777

Check warning on line 1510 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Extract this nested conditional operator into an independent statement.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfui&open=AZ1Sm6RDWzwQiKxZVfui&pullRequest=9777

Check warning on line 329 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace with the version of "std::ranges::any_of" that takes a range.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfuQ&open=AZ1Sm6RDWzwQiKxZVfuQ&pullRequest=9777

Check failure on line 255 in src/libsync/discovery.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 105 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6RDWzwQiKxZVfuN&open=AZ1Sm6RDWzwQiKxZVfuN&pullRequest=9777

Check warning on line 162 in src/libsync/propagateupload.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Merge this "if" statement with the enclosing one.

See more on https://sonarcloud.io/project/issues?id=nextcloud_desktop&issues=AZ1Sm6VQWzwQiKxZVfvG&open=AZ1Sm6VQWzwQiKxZVfvG&pullRequest=9777