refactor: address SonarCloud issues and reduce code duplication - #20
Conversation
Added a quality gate status badge to the README.
There was a problem hiding this comment.
Code Review
This pull request refactors the synchronization logic by centralizing metadata updates and service name retrieval, and introduces support for pulling files that do not exist locally. It also reduces code duplication in batch operations by consolidating push and pull logic and adds a SonarCloud quality badge to the README. A redundant network call was identified in the batch operation logic that should be removed to improve efficiency.
| await this.gitService.listFiles(this.settings.branch); | ||
| await this.gitignoreManager.loadGitignores(); |
There was a problem hiding this comment.
The call to this.gitService.listFiles is redundant as its result is not used, leading to an unnecessary network request. It should be removed to improve the efficiency of batch operations.
| await this.gitService.listFiles(this.settings.branch); | |
| await this.gitignoreManager.loadGitignores(); | |
| await this.gitignoreManager.loadGitignores(); |
|
|
🎉 This PR is included in version 1.0.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |



This PR addresses the SonarCloud Quality Gate failures identified in the latest builds:
SyncManagerandSyncStatusViewto use shared helper methods for batch operations, significantly reducing code duplication (from 3.6% to within limits).atob/btoawithBufferin GitHub and GitLab services.SyncStatusView.sonar-project.propertieswith correct coverage exclusions to match the test suite.manifest.json,versions.json, andpackage.jsonto 1.1.0.onunloadstructure inmain.tsfollowing Obsidian requirements.Verified with
npm run lintandnpm run test(18/18 tests passed).