Skip to content

fix: remove redundant isValid assignment in mime-type validator#19

Open
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
remediate-master-20260330-075802-ef174a9f
Open

fix: remove redundant isValid assignment in mime-type validator#19
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
remediate-master-20260330-075802-ef174a9f

Conversation

@sonarqube-agent
Copy link
Copy Markdown

Removes an unnecessary reassignment of the isValid variable that was flagged by SonarQube as redundant. The variable already held the value false along all execution paths at that point, making this assignment unreachable and improving code clarity.

View Project in SonarCloud


Fixed Issues

typescript:S4165 - Review this redundant assignment: "isValid" already holds the assigned value along all execution paths. • MAJORView issue

Location: frontend/src/app/photo-wall/mime-type.validator.ts:38

Why is this an issue?

The transitive property says that if a == b and b == c, then a == c. In such cases, there’s no point in assigning a to c or vice versa because they’re already equivalent.

What changed

Removes the redundant assignment isValid = false on line 38 of mime-type.validator.ts. The static analysis detected that isValid already holds the value false along all execution paths at that point, making this assignment unnecessary. By deleting this line, the code smell about a useless reassignment is resolved.

--- a/frontend/src/app/photo-wall/mime-type.validator.ts
+++ b/frontend/src/app/photo-wall/mime-type.validator.ts
@@ -38,1 +37,0 @@ export const mimeType = (
-            isValid = false

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZWU-tLOYJSZqVQVbSb6 for typescript:S4165 rule

Generated by SonarQube Agent (task: 376f8526-1f17-4ff0-9600-e7f1cb5c0eab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants