Angular html template dynamic attributes being incorrectly flagged

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.

Hey there.

I’ve moved your post to the section on reporting false-positives.

Can you provide a text-based code sample, rather than a screenshot?

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?

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.