msc-ddiaz
(Daniel Diaz)
January 14, 2025, 7:53pm
1
There seems to still be an issue with incorrectly flagging dynamic attributes in Angular templates:
It looks like Jira was opened up to address this but unsure if this has regressed since. Apologies, I’m not able to find the version of sonar cloud my organization is in.
Colin
(Colin)
January 15, 2025, 9:31am
2
Hey there.
I’ve moved your post to the section on reporting false-positives.
Hey SonarSource Community!
False-positives happen , as do false-negatives, and we’re eager to fix them. We are thrilled when our users report problems, so we can make our products better.
What is a false-positive (FP)?
A false-positive is when an issue is raised unexpectedly on code that should not trigger an issue, or where the suggested action doesn’t make any sense for the code.
What is a false-negative (FN)?
A false-negative is when an issue should be raised on a piece of code, but isn’t.
…
Can you provide a text-based code sample, rather than a screenshot?
msc-ddiaz
(Daniel Diaz)
January 15, 2025, 5:14pm
3
Hey there, thank you for your reply. Here’s the html template in Angular that’s being flagged:
<input
type="checkbox"
role="switch"
class="form-control form-check-input"
formControlName="isLiasion"
name="isLiasion"
id="isLiasion"
aria-checked="profileForm.get('isLiason').value"
/>
@msc-ddiaz , thanks for the reproducer.
I was not able to reproduce the issue with it, but I assume it should read like this instead:
<input
type="checkbox"
role="switch"
class="form-control form-check-input"
formControlName="isLiasion"
name="isLiasion"
id="isLiasion"
[attr.aria-checked]="profileForm.get('isLiason').value"
/>
This one triggers S6807. Can you confirm that this is the reproducer that you intended to share with us?
msc-ddiaz
(Daniel Diaz)
January 23, 2025, 8:08pm
7
Yes, my apologies! That is what I intended to share instead
1 Like
Perfect, thanks for the confirmation.
I created a Jira ticket to track the progress on the fix.
Regards,
Eric.