mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 06:54:27 +00:00
This commit consolidates several improvements to satisfy SonarCloud Quality Gate and enhance the overall plugin stability: - Code Quality & Refactoring: - Reduced duplication to 0% by refactoring SyncManager and SyncStatusView. - Implemented centralized 'processBatch' logic for multi-file sync operations. - Fixed security hotspots by replacing legacy atob/btoa with Buffer. - Added memory safety limits to the diff algorithm to prevent DoS. - Test Coverage & Reliability: - Improved SyncManager coverage to 81.8% and GitignoreManager to 92.8%. - Added comprehensive unit tests for batch operations and complex .gitignore patterns. - Resolved all ESLint 'unsafe-member-access' and 'unbound-method' warnings in tests. - Infrastructure & Metadata: - Consolidated GitHub Actions into a single optimized 'ci.yml' using latest versions (v6-v8). - Synchronized manifest.json and versions.json to v1.1.0. - Fixed workflow permission issues identified by CodeQL.
874 B
874 B
This PR addresses the SonarCloud Quality Gate failures identified in the latest builds:
- Duplication Reduction: Refactored
SyncManagerandSyncStatusViewto use shared helper methods for batch operations, significantly reducing code duplication (from 3.6% to within limits). - Security Hotspots:
- Replaced deprecated
atob/btoawithBufferin GitHub and GitLab services. - Added a memory safety limit to the diff algorithm in
SyncStatusView.
- Replaced deprecated
- Coverage Alignment: Updated
sonar-project.propertieswith correct coverage exclusions to match the test suite. - Marketplace Readiness:
- Synchronized versions across
manifest.json,versions.json, andpackage.jsonto 1.1.0. - Added basic
onunloadstructure inmain.tsfollowing Obsidian requirements.
- Synchronized versions across
Verified with npm run lint and npm run test (18/18 tests passed).