-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
category/bugsruleIssues related to new or existing linter rulesIssues related to new or existing linter rules
Description
Another issue I saw in a policy in the wild today is where one definition of an incremental rule is essentially dead code, due to a common condition that would be met by the least complex definition in both rules. Extremely simplified:
allow if "admin" in input.user.roles
alow if {
"admin" in input.user.roles
endswith(input.user.email, "@acmecorp.com") # this is pointless
}
The second rule definition is of course pointless in this case, as the first condition of both rules is the same, and there's no reason to evaluate the email address of the user if they're an admin.
There's probably a million things for where this could be true but we can't easily find using only static analysis. That's fine. Just covering the easy/obvious cases is still better than no coverage.
Metadata
Metadata
Assignees
Labels
category/bugsruleIssues related to new or existing linter rulesIssues related to new or existing linter rules