Skip to content

Conversation

@lennartdohmann
Copy link
Member

No description provided.

@lennartdohmann lennartdohmann requested a review from Copilot August 15, 2025 14:03
@lennartdohmann lennartdohmann self-assigned this Aug 15, 2025

This comment was marked as outdated.

@lennartdohmann lennartdohmann requested a review from Copilot August 15, 2025 18:46

This comment was marked as outdated.

@lennartdohmann lennartdohmann marked this pull request as draft August 15, 2025 18:48
@lennartdohmann lennartdohmann force-pushed the apply-nextcloud-coding-standards branch 10 times, most recently from ef5eeac to d6b3292 Compare August 20, 2025 11:20
@lennartdohmann lennartdohmann requested a review from Copilot August 20, 2025 12:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request applies Nextcloud coding standards to the codebase, primarily focusing on license header compliance and code style consistency. The changes include adding SPDX license headers to all files, updating coding standards configurations, reorganizing some code structure, and making minor version updates.

  • Adds SPDX license headers (AGPL-3.0-or-later) to all source files and license files for assets
  • Updates PHP coding standards configuration and applies formatting improvements
  • Reorganizes some code structure and adds missing override attributes
  • Updates dependency versions and development tooling

Reviewed Changes

Copilot reviewed 93 out of 100 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
lib/**/*.php Added SPDX headers and applied coding standards formatting
src/**/*.js Added SPDX headers and minor formatting improvements
tests/**/*.php Added SPDX headers and updated test formatting
img/**/*.license Added license files for image assets
.php-cs-fixer.dist.php New coding standards configuration file
composer.json Updated dependency versions and scripts
Various config files Added SPDX headers and minor updates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

case 'Pup':
showWarning(t('gdatavaas', 'The file "' + file.basename + '" has been scanned with G DATA as verdict PUP (Potentially unwanted program)'));
showWarning(t('gdatavaas', 'The file "' + file.basename + '" has been scanned with G DATA as ' +
'verdict PUP (Potentially unwanted program)'));
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] String concatenation should use template literals for better readability. Consider using: showWarning(t('gdatavaas', \The file "${file.basename}" has been scanned with G DATA as verdict PUP (Potentially unwanted program)`))`

Suggested change
'verdict PUP (Potentially unwanted program)'));
showWarning(t('gdatavaas', `The file "${file.basename}" has been scanned with G DATA as verdict PUP (Potentially unwanted program)`));

Copilot uses AI. Check for mistakes.
use OCA\GDataVaas\AppInfo\Application;
use OCA\GDataVaas\Service\FileService;
use OCA\GDataVaas\Service\TagService;
use OCA\GDataVaas\Service\VerdictService;
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Import statements should be grouped with framework imports before application imports. The TestLogger import should come after the OCA\GDataVaas imports.

Suggested change
use OCA\GDataVaas\Service\VerdictService;
use OCA\GDataVaas\AppInfo\Application;
use OCA\GDataVaas\Service\FileService;
use OCA\GDataVaas\Service\TagService;
use OCA\GDataVaas\Service\VerdictService;
use ColinODell\PsrTestLogger\TestLogger;

Copilot uses AI. Check for mistakes.
namespace OCA\GDataVaas\Service;

use Exception;
use OC\User\NoUserException;
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Import of OC\User\NoUserException should be grouped with other OC imports and placed before OCA imports to follow typical import ordering conventions.

Copilot uses AI. Check for mistakes.
$this->logger->error("Failed to scan uploaded file '{$node->getName()}' with ID '{$node->getId()}': {$e->getMessage()}");
$this->logger->error(
"Failed to scan uploaded file '{$node->getName()}' with
ID '{$node->getId()}': {$e->getMessage()}"
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The error message spans multiple lines in an inconsistent way. Consider using a single concatenated string or proper multi-line string formatting for better readability.

Suggested change
ID '{$node->getId()}': {$e->getMessage()}"
"Failed to scan uploaded file '{$node->getName()}' with ID '{$node->getId()}': {$e->getMessage()}"

Copilot uses AI. Check for mistakes.
}
return new JSONResponse(
['error' => "An unexpected error occurred while scanning file $fileId with GData VaaS. Please
check the logs for more information and contact your administrator."], 500);
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Long error message string is split across multiple lines inconsistently. Consider using a single string or proper multi-line string formatting for better readability.

Suggested change
check the logs for more information and contact your administrator."], 500);
['error' => "An unexpected error occurred while scanning file $fileId with GData VaaS. Please check the logs for more information and contact your administrator."], 500);

Copilot uses AI. Check for mistakes.
['name' => 'settings#getSendMailSummaryOfMaliciousFiles', 'url'
=> '/getSendMailSummaryOfMaliciousFiles', 'verb' => 'GET'],
['name' => 'settings#setSendMailSummaryOfMaliciousFiles', 'url'
=> '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST']
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Array formatting is inconsistent with line breaks in the middle of array elements. Consider keeping each complete array element on a single line or use consistent multi-line formatting.

Suggested change
=> '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST']
['name' => 'settings#getSendMailSummaryOfMaliciousFiles', 'url' => '/getSendMailSummaryOfMaliciousFiles', 'verb' => 'GET'],
['name' => 'settings#setSendMailSummaryOfMaliciousFiles', 'url' => '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST']

Copilot uses AI. Check for mistakes.
$appConfig->method(
'getValueBool')->with(Application::APP_ID,
'disableUnscannedTag')->willReturn(true
);
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Method call is unnecessarily split across multiple lines with inconsistent indentation. Consider using a single line or proper multi-line formatting with consistent indentation.

Suggested change
);
$appConfig
->method('getValueBool')
->with(Application::APP_ID, 'disableUnscannedTag')
->willReturn(true);

Copilot uses AI. Check for mistakes.
@lennartdohmann lennartdohmann force-pushed the apply-nextcloud-coding-standards branch from 6620904 to e9f33ed Compare August 20, 2025 12:42
@lennartdohmann lennartdohmann force-pushed the apply-nextcloud-coding-standards branch from e9f33ed to 01b81e9 Compare August 20, 2025 12:43
@lennartdohmann lennartdohmann marked this pull request as ready for review August 20, 2025 12:45
@lennartdohmann lennartdohmann merged commit ca69689 into main Aug 20, 2025
20 checks passed
@lennartdohmann lennartdohmann deleted the apply-nextcloud-coding-standards branch August 26, 2025 11:28
lennartdohmann added a commit that referenced this pull request Aug 28, 2025
* fix: correct syntax error in ScanService.php for constant declaration for PHP < 8.3 (#227)

* chore(deps): update dependency webpack-dev-server to v5.2.2 (#225)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update all non-major dependencies (#231)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency psalm/phar to v6.13.0 (#232)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update all non-major dependencies (#233)

Co-authored-by: Renovate Bot <[email protected]>

* Add a quicker way for development with a local Nextcloud server and the app code changeable inside this server (#234)

* Add Nextclouds worklfow templates and apply Nextcloud coding style (#235)

* Add maximum scan size setting for file uploads (#236)

* Devcontainer and Workflow Performance (#237)

- Faster local development in devcontainer
- Add Make stages for local fast developing as well as unit and bats tests
- Remove unmaintained files from old debugging sessions`
- Cleanup unused files and bundle utility scripts

* Settings improvements (#238)

- Add button to test current vaas configuration
- Rename app settings to be more intuitive

* Add additional settings (#239)

- Control scan timeout
- Control usage of cache
- Control usage of hash lookup

* Refactor logging messages and remove redundant debug statements (#240)

* Update README with development environment setup instructions (#241)

* Remove unused settings (#242)

- Malicious file notifications summary
- Scan only new files

* Add make target for production like local setup (#243)

* Outsource file scan actions (#244)

---------

Co-authored-by: vaas-bot <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
lennartdohmann added a commit that referenced this pull request Aug 28, 2025
* fix: correct syntax error in ScanService.php for constant declaration for PHP < 8.3 (#227)

* Add a quicker way for development with a local Nextcloud server and the app code changeable inside this server (#234)

* Add Nextclouds worklfow templates and apply Nextcloud coding style (#235)

* Add maximum scan size setting for file uploads (#236)

* Devcontainer and Workflow Performance (#237)

- Faster local development in devcontainer
- Add Make stages for local fast developing as well as unit and bats tests
- Remove unmaintained files from old debugging sessions`
- Cleanup unused files and bundle utility scripts

* Settings improvements (#238)

- Add button to test current vaas configuration
- Rename app settings to be more intuitive

* Add additional settings (#239)

- Control scan timeout
- Control usage of cache
- Control usage of hash lookup

* Refactor logging messages and remove redundant debug statements (#240)

* Update README with development environment setup instructions (#241)

* Remove unused settings (#242)

- Malicious file notifications summary
- Scan only new files

* Add make target for production like local setup (#243)

* Outsource file scan actions (#244)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants