Skip to content

[GFX-224] 抑制 Sha1Helper.ComputeFileHash(string) 的 Sonar S4790 弱哈希告警 - #166

Merged
AlianBlank merged 1 commit into
mainfrom
feature/GFX-224
Aug 5, 2026
Merged

AlianBlank merged 1 commit into
mainfrom
feature/GFX-224

Conversation

@AlianBlank

Copy link
Copy Markdown
Contributor

Linear: GFX-224

Sha1Helper.ComputeFileHash(string filePath) 方法体内 line 145 using var sha1 = SHA1.Create(); 被 Sonar csharpsquid:S4790 标记 CRITICAL/VULNERABILITY(issue AZ-m77JuoUUmmpKU65vP,报告位置 Sha1Helper.cs:141)。在方法签名上方加 1 行 [SuppressMessage("Sonar Code Smell", "S4790:Use a stronger hashing algorithm", Justification = "SHA-1 is intentionally used here for non-cryptographic checksum / fingerprint / cache-key scenarios; for security-sensitive use cases call Sha256Helper instead.")]。顶部 using System.Diagnostics.CodeAnalysis; 已由前序 commit(GFX-221/C35、GFX-223/C34)补齐于 line 35,本次无需再加。原则与同文件 C34/C35/C36(ComputeHashAsync / ComputeHash(Stream) / ComputeHash(byte[]) 的 S4790 抑制)完全一致;至此 Sha1Helper 全部 4 处 SHA1.Create() 站点抑制齐全。公共 API、方法体、Sha1HelperTests 零改动,整库 1807 测试全绿。

Linear: GFX-224
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

GFX-224

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AlianBlank, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ce606ae-47f6-40bc-bac4-199aa479ba17

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6966f and 04d6677.

📒 Files selected for processing (1)
  • GameFrameX.Foundation.Hash/Sha1Helper.cs

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@AlianBlank
AlianBlank merged commit 4df8c7f into main Aug 5, 2026
2 checks passed
@AlianBlank
AlianBlank deleted the feature/GFX-224 branch August 5, 2026 06:33
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.

1 participant