mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Ruby: Disable summaries that clash with Array
Some String methods are named identically to Array methods, and this leads to overlapping flow summaries. These adversely affect the original Array flow summaries.
This commit is contained in:
@@ -175,7 +175,12 @@ module String {
|
||||
* A flow summary for `String#concat` and `String#prepend`.
|
||||
*/
|
||||
private class ConcatSummary extends SimpleSummarizedCallable {
|
||||
ConcatSummary() { this = ["concat", "prepend"] }
|
||||
ConcatSummary() {
|
||||
// `concat` and `prepend` omitted because they clash with the summaries for
|
||||
// `Array#concat` and `Array#prepend`.
|
||||
// this = ["concat", "prepend"]
|
||||
none()
|
||||
}
|
||||
|
||||
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
|
||||
input = ["Receiver", "Argument[_]"] and
|
||||
@@ -304,7 +309,11 @@ module String {
|
||||
* A flow summary for `String#insert`.
|
||||
*/
|
||||
private class InsertSummary extends SimpleSummarizedCallable {
|
||||
InsertSummary() { this = "insert" }
|
||||
InsertSummary() {
|
||||
this = "insert" and
|
||||
// Disabled because it clashes with the summary for Array#insert.
|
||||
none()
|
||||
}
|
||||
|
||||
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user