CodeQL queries 1.25
Skip to end of metadata
Go to start of metadata

Finds local variables that are not accessed.

import csharp

from LocalVariable v
where not exists(v.getAnAccess())
select v