mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #5583 from lcartey/cs/restrict-jump-to-def
C#: Exclude jump-to-def information for elements with too many locations
This commit is contained in:
@@ -187,5 +187,11 @@ cached
|
||||
Declaration definitionOf(Use use, string kind) {
|
||||
result = use.getDefinition() and
|
||||
result.fromSource() and
|
||||
kind = use.getUseType()
|
||||
kind = use.getUseType() and
|
||||
// Some entities have many locations. This can arise for files that
|
||||
// are duplicated multiple times in the database at different
|
||||
// locations. Rather than letting the result set explode, we just
|
||||
// exclude results that are "too ambiguous" -- we could also arbitrarily
|
||||
// pick one location later on.
|
||||
strictcount(result.getLocation()) < 10
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user