Free Microsoft GH-500 Actual Exam Questions - Question 2 Discussion
Why should you dismiss a code scanning alert?
It’s A, since you shouldn’t dismiss alerts unless the issue’s actually fixed.
What about A? Fixing the issue seems like the main reason to dismiss alerts.
B tbh doesn't really fit because dismissing alerts to stop new problems sounds off—alerts are meant to catch issues before they happen, not just to be ignored. D is clearly out since production errors need fixing, not dismissal. So between A and C, A feels safer since you want to clear alerts only after actually fixing the code. C could be tempting but test code might sometimes affect other parts unexpectedly, so dismissing without caution isn't ideal.
Makes sense to go with A here. If the underlying problem is fixed, keeping the alert only clutters things and wastes time. C could be risky unless you’re absolutely sure that test code won’t impact anything else, but that’s not always guaranteed. D doesn’t fit because a production error isn’t a reason to dismiss an alert—it’s actually a reason to fix it. So A feels cleaner and safer overall.
A imo. If you’ve already fixed the problem the alert flagged, it’s reasonable to dismiss it so it doesn’t keep popping up. C is good too, but dismissing because it’s test code alone doesn’t cover cases where test code might still cause issues downstream. B and D don’t really fit since dismissing alerts to prevent new problems or because of production errors doesn’t align with how code scanning alerts are meant to be handled.
I think C makes the most sense since test code errors usually don’t affect the actual app. D feels off because a production error isn’t something you’d just dismiss.