variables are either marked as covered when used or just ignored completely?
any variable, whether its used or not is listed as 'not_covered' in the coverage report
Using the example policy and test from Getting Started
opa test /srv/app/example.rego /srv/app/example_test.rego -v --coverage --format=json
the coverage report indicates that row 9 is not covered
"not_covered": [
{
"start": {
"row": 9
},
"end": {
"row": 9
}
}
],
Line 9 of example.rego reads 'some profile_id' (which is referenced in line 12)

Version: 0.16.0
Build Commit: b50e626
Build Timestamp: 2019-12-19T13:13:32Z
Build Hostname: 08f277b56fc6
@segrax thanks for filing this! Sorry for the delayed response (reason: holidays, catching up on issues/emails after coming back, etc.)
This looks like a bug in the coverage reporter/calculation (cover/cover.go). The problem (I think) is that some statements do not actually get evaluated (they're used for semantic checks but the evaluator doesn't look at them.) The coverage reporter is probably should just exclude these statements when checking whether statements have been executed.
Most helpful comment
@segrax thanks for filing this! Sorry for the delayed response (reason: holidays, catching up on issues/emails after coming back, etc.)
This looks like a bug in the coverage reporter/calculation (cover/cover.go). The problem (I think) is that
somestatements do not actually get evaluated (they're used for semantic checks but the evaluator doesn't look at them.) The coverage reporter is probably should just exclude these statements when checking whether statements have been executed.