mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
MaD: Use "namespace" instead "package" in shared code.
This commit is contained in:
@@ -54,5 +54,5 @@ extensible predicate neutralModel(
|
|||||||
module Extensions implements SharedMaD::ExtensionsSig {
|
module Extensions implements SharedMaD::ExtensionsSig {
|
||||||
import ExternalFlowExtensions
|
import ExternalFlowExtensions
|
||||||
|
|
||||||
predicate packageGrouping(string group, string package) { none() }
|
predicate namespaceGrouping(string group, string namespace) { none() }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,5 +54,5 @@ extensible predicate neutralModel(
|
|||||||
module Extensions implements SharedMaD::ExtensionsSig {
|
module Extensions implements SharedMaD::ExtensionsSig {
|
||||||
import ExternalFlowExtensions
|
import ExternalFlowExtensions
|
||||||
|
|
||||||
predicate packageGrouping(string group, string package) { none() }
|
predicate namespaceGrouping(string group, string namespace) { none() }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,6 @@ extensible predicate packageGrouping(string group, string package);
|
|||||||
|
|
||||||
module Extensions implements SharedMaD::ExtensionsSig {
|
module Extensions implements SharedMaD::ExtensionsSig {
|
||||||
import ExternalFlowExtensions
|
import ExternalFlowExtensions
|
||||||
|
|
||||||
|
predicate namespaceGrouping = packageGrouping/2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,5 +99,5 @@ extensible predicate experimentalSummaryModel(
|
|||||||
module Extensions implements SharedMaD::ExtensionsSig {
|
module Extensions implements SharedMaD::ExtensionsSig {
|
||||||
import ExternalFlowExtensions
|
import ExternalFlowExtensions
|
||||||
|
|
||||||
predicate packageGrouping(string group, string package) { none() }
|
predicate namespaceGrouping(string group, string namespace) { none() }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ signature module ExtensionsSig {
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds if the package `package` is part of the group `group`.
|
* Holds if the namespace `namespace` is part of the group `group`.
|
||||||
*/
|
*/
|
||||||
predicate packageGrouping(string group, string package);
|
predicate namespaceGrouping(string group, string namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
signature module InputSig {
|
signature module InputSig {
|
||||||
@@ -166,14 +166,14 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the prefix for a group of packages/namespaces. */
|
/** Gets the prefix for a group of namespaces. */
|
||||||
private string groupPrefix() { result = "group:" }
|
private string groupPrefix() { result = "group:" }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a package/namespace represented by `namespaceOrGroup`.
|
* Gets a namespace represented by `namespaceOrGroup`.
|
||||||
*
|
*
|
||||||
* If `namespaceOrGroup` is of the form `group:<groupname>` then `result` is a
|
* If `namespaceOrGroup` is of the form `group:<groupname>` then `result` is a
|
||||||
* package/namespace in the group `<groupname>`, as determined by `packageGrouping`.
|
* namespace in the group `<groupname>`, as determined by `namespaceGrouping`.
|
||||||
* Otherwise, `result` is `namespaceOrGroup`.
|
* Otherwise, `result` is `namespaceOrGroup`.
|
||||||
*/
|
*/
|
||||||
bindingset[namespaceOrGroup]
|
bindingset[namespaceOrGroup]
|
||||||
@@ -182,7 +182,7 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
|
|||||||
result = namespaceOrGroup
|
result = namespaceOrGroup
|
||||||
or
|
or
|
||||||
exists(string group |
|
exists(string group |
|
||||||
Extensions::packageGrouping(group, result) and
|
Extensions::namespaceGrouping(group, result) and
|
||||||
namespaceOrGroup = groupPrefix() + group
|
namespaceOrGroup = groupPrefix() + group
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user