You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#283 is adding the ability to suppress reports at call sites using a code comment. In most cases, the suppression behaves as expected. There is one case where the (lack of) suppression behavior is surprising:
// TODO(#284): we don't actually want a report herefmt.Println(
core.SinkAndReturn(s), // levee.DoNotReport // want "a source has reached a sink"
)
This is because in the comment map, the // levee.DoNotReport comment is (unexpectedly) associated with the s identifier, not the core.SinkAndReturn call.
Since s is an argument to core.SinkAndReturn, we could find the identifier by traversing the tree under the CallExpr that corresponds to core.SinkAndReturn and find the suppressing comment on the identifier. However, looking for suppressing comments on the arguments may cause misleading behavior, as in other cases it would suggest that it is possible to suppress a report for a specific argument, which isn't the case.
#283 is adding the ability to suppress reports at call sites using a code comment. In most cases, the suppression behaves as expected. There is one case where the (lack of) suppression behavior is surprising:
This is because in the comment map, the
// levee.DoNotReport
comment is (unexpectedly) associated with thes
identifier, not thecore.SinkAndReturn
call.Since
s
is an argument tocore.SinkAndReturn
, we could find the identifier by traversing the tree under theCallExpr
that corresponds tocore.SinkAndReturn
and find the suppressing comment on the identifier. However, looking for suppressing comments on the arguments may cause misleading behavior, as in other cases it would suggest that it is possible to suppress a report for a specific argument, which isn't the case.See #283 (comment) for additional discussion.
Here is a bit of code that can be used to dump the comment map for a file, which may be handy in investigating this issue.
The text was updated successfully, but these errors were encountered: