mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Note that unusedLocation can raise an alert for used but inaccessible locations
This commit is contained in:
committed by
Ian Lynagh
parent
920599fcf5
commit
20d56094ee
@@ -16,6 +16,13 @@ Location backwardsLocation() {
|
||||
result.getStartColumn() > result.getEndColumn()
|
||||
}
|
||||
|
||||
// Normally a location should tag at least one locatable entity.
|
||||
// Note this is not absolutely necessarily a bug (it does not always indicate a location is
|
||||
// an orphan in database terms), because classes that are seen both as source code and as a
|
||||
// .class file are extracted using both locations, with `Top.getLocation` filtering out the
|
||||
// class-file location when both a source- and a class-file location are present in the
|
||||
// database. However at present the Java extractor always uses the class-file location at
|
||||
// least to locate a `File`, so such a location does end up with a single use.
|
||||
Location unusedLocation() {
|
||||
not exists(Top t | t.getLocation() = result) and
|
||||
not exists(XMLLocatable x | x.getLocation() = result) and
|
||||
|
||||
Reference in New Issue
Block a user