mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
All languages: Add getPrimaryQlClasses()
This is a non-overridable predicate that concatenates all the getAPrimaryQlClass() results into a comma-separated string.
This commit is contained in:
@@ -100,6 +100,11 @@ class Top extends @top {
|
||||
cached
|
||||
string toString() { hasName(this, result) }
|
||||
|
||||
/**
|
||||
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
|
||||
*/
|
||||
final string getPrimaryQlClasses() { result = concat(getAPrimaryQlClass(), ",") }
|
||||
|
||||
/**
|
||||
* Gets the name of a primary CodeQL class to which this element belongs.
|
||||
*
|
||||
|
||||
@@ -89,7 +89,7 @@ private predicate duplicateMetadata(Field f) {
|
||||
* Retrieves the canonical QL class(es) for entity `el`
|
||||
*/
|
||||
private string getQlClass(Top el) {
|
||||
result = "[" + concat(el.getAPrimaryQlClass(), ",") + "] "
|
||||
result = "[" + el.getPrimaryQlClasses() + "] "
|
||||
// Alternative implementation -- do not delete. It is useful for QL class discovery.
|
||||
// result = "[" + concat(el.getAQlClass(), ",") + "] "
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user