Skip to content

Commit 4901deb

Browse files
authored
Merge pull request #10004 from hvitved/csharp/mad-this-rename
C#: Rename `Argument[Qualifier]` to `Argument[this]` in MaD
2 parents 1e1e231 + e4c257d commit 4901deb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+22435
-22435
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ string getParameterPositionCsv(ParameterPosition pos) {
199199
result = pos.getPosition().toString()
200200
or
201201
pos.isThisParameter() and
202-
result = "Qualifier"
202+
result = "this"
203203
}
204204

205205
/** Gets the textual representation of an argument position in the format used for flow summaries. */
206206
string getArgumentPositionCsv(ArgumentPosition pos) {
207207
result = pos.getPosition().toString()
208208
or
209209
pos.isQualifier() and
210-
result = "This"
210+
result = "this"
211211
}
212212

213213
/** Holds if input specification component `c` needs a reference. */
@@ -287,7 +287,7 @@ bindingset[s]
287287
ArgumentPosition parseParamBody(string s) {
288288
result.getPosition() = AccessPath::parseInt(s)
289289
or
290-
s = "This" and
290+
s = "this" and
291291
result.isQualifier()
292292
}
293293

@@ -296,6 +296,6 @@ bindingset[s]
296296
ParameterPosition parseArgBody(string s) {
297297
result.getPosition() = AccessPath::parseInt(s)
298298
or
299-
s = "Qualifier" and
299+
s = "this" and
300300
result.isThisParameter()
301301
}

csharp/ql/lib/semmle/code/csharp/frameworks/JsonNET.qll

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ module JsonNET {
228228
override predicate row(string row) {
229229
row =
230230
[
231-
"Newtonsoft.Json.Linq;JToken;false;SelectToken;(System.String);;Argument[Qualifier];ReturnValue;taint;manual",
232-
"Newtonsoft.Json.Linq;JToken;false;SelectToken;(System.String,Newtonsoft.Json.Linq.JsonSelectSettings);;Argument[Qualifier];ReturnValue;taint;manual",
233-
"Newtonsoft.Json.Linq;JToken;false;SelectToken;(System.String,System.Boolean);;Argument[Qualifier];ReturnValue;taint;manual",
234-
"Newtonsoft.Json.Linq;JToken;false;ToString;();;Argument[Qualifier];ReturnValue;taint;manual",
235-
"Newtonsoft.Json.Linq;JToken;false;ToString;(Newtonsoft.Json.Formatting,Newtonsoft.Json.JsonConverter[]);;Argument[Qualifier];ReturnValue;taint;manual",
231+
"Newtonsoft.Json.Linq;JToken;false;SelectToken;(System.String);;Argument[this];ReturnValue;taint;manual",
232+
"Newtonsoft.Json.Linq;JToken;false;SelectToken;(System.String,Newtonsoft.Json.Linq.JsonSelectSettings);;Argument[this];ReturnValue;taint;manual",
233+
"Newtonsoft.Json.Linq;JToken;false;SelectToken;(System.String,System.Boolean);;Argument[this];ReturnValue;taint;manual",
234+
"Newtonsoft.Json.Linq;JToken;false;ToString;();;Argument[this];ReturnValue;taint;manual",
235+
"Newtonsoft.Json.Linq;JToken;false;ToString;(Newtonsoft.Json.Formatting,Newtonsoft.Json.JsonConverter[]);;Argument[this];ReturnValue;taint;manual",
236236
]
237237
}
238238
}
@@ -253,21 +253,21 @@ module JsonNET {
253253
override predicate row(string row) {
254254
row =
255255
[
256-
"Newtonsoft.Json.Linq;JObject;false;Add;(System.Collections.Generic.KeyValuePair<System.String,Newtonsoft.Json.Linq.JToken>);;Argument[0].Property[System.Collections.Generic.KeyValuePair<,>.Key];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
257-
"Newtonsoft.Json.Linq;JObject;false;Add;(System.Collections.Generic.KeyValuePair<System.String,Newtonsoft.Json.Linq.JToken>);;Argument[0].Property[System.Collections.Generic.KeyValuePair<,>.Value];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
258-
"Newtonsoft.Json.Linq;JObject;false;JObject;(Newtonsoft.Json.Linq.JObject);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
259-
"Newtonsoft.Json.Linq;JObject;false;JObject;(Newtonsoft.Json.Linq.JObject);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
260-
"Newtonsoft.Json.Linq;JObject;false;JObject;(System.Object[]);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
261-
"Newtonsoft.Json.Linq;JObject;false;JObject;(System.Object[]);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
256+
"Newtonsoft.Json.Linq;JObject;false;Add;(System.Collections.Generic.KeyValuePair<System.String,Newtonsoft.Json.Linq.JToken>);;Argument[0].Property[System.Collections.Generic.KeyValuePair<,>.Key];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
257+
"Newtonsoft.Json.Linq;JObject;false;Add;(System.Collections.Generic.KeyValuePair<System.String,Newtonsoft.Json.Linq.JToken>);;Argument[0].Property[System.Collections.Generic.KeyValuePair<,>.Value];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
258+
"Newtonsoft.Json.Linq;JObject;false;JObject;(Newtonsoft.Json.Linq.JObject);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
259+
"Newtonsoft.Json.Linq;JObject;false;JObject;(Newtonsoft.Json.Linq.JObject);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
260+
"Newtonsoft.Json.Linq;JObject;false;JObject;(System.Object[]);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
261+
"Newtonsoft.Json.Linq;JObject;false;JObject;(System.Object[]);;Argument[0].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
262262
"Newtonsoft.Json.Linq;JObject;false;Parse;(System.String);;Argument[0];ReturnValue;taint;manual",
263263
"Newtonsoft.Json.Linq;JObject;false;Parse;(System.String,Newtonsoft.Json.Linq.JsonLoadSettings);;Argument[0];ReturnValue;taint;manual",
264-
"Newtonsoft.Json.Linq;JObject;false;get_Item;(System.Object);;Argument[Qualifier].Element;ReturnValue;value;manual",
265-
"Newtonsoft.Json.Linq;JObject;false;get_Item;(System.Object);;Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];ReturnValue;value;manual",
266-
"Newtonsoft.Json.Linq;JObject;false;get_Item;(System.String);;Argument[Qualifier].Element;ReturnValue;value;manual",
267-
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[0];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
268-
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[Qualifier].Element;value;manual",
269-
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[Qualifier].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
270-
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.String,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[Qualifier].Element;value;manual",
264+
"Newtonsoft.Json.Linq;JObject;false;get_Item;(System.Object);;Argument[this].Element;ReturnValue;value;manual",
265+
"Newtonsoft.Json.Linq;JObject;false;get_Item;(System.Object);;Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];ReturnValue;value;manual",
266+
"Newtonsoft.Json.Linq;JObject;false;get_Item;(System.String);;Argument[this].Element;ReturnValue;value;manual",
267+
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[0];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Key];value;manual",
268+
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[this].Element;value;manual",
269+
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[this].Element.Property[System.Collections.Generic.KeyValuePair<,>.Value];value;manual",
270+
"Newtonsoft.Json.Linq;JObject;false;set_Item;(System.String,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[this].Element;value;manual",
271271
]
272272
}
273273
}
@@ -277,8 +277,8 @@ module JsonNET {
277277
override predicate row(string row) {
278278
row =
279279
[
280-
"Newtonsoft.Json.Linq;JArray;false;get_Item;(System.Object);;Argument[Qualifier].Element;ReturnValue;value;manual",
281-
"Newtonsoft.Json.Linq;JArray;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[Qualifier].Element;value;manual",
280+
"Newtonsoft.Json.Linq;JArray;false;get_Item;(System.Object);;Argument[this].Element;ReturnValue;value;manual",
281+
"Newtonsoft.Json.Linq;JArray;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[this].Element;value;manual",
282282
]
283283
}
284284
}
@@ -288,8 +288,8 @@ module JsonNET {
288288
override predicate row(string row) {
289289
row =
290290
[
291-
"Newtonsoft.Json.Linq;JConstructor;false;get_Item;(System.Object);;Argument[Qualifier].Element;ReturnValue;value;manual",
292-
"Newtonsoft.Json.Linq;JConstructor;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[Qualifier].Element;value;manual",
291+
"Newtonsoft.Json.Linq;JConstructor;false;get_Item;(System.Object);;Argument[this].Element;ReturnValue;value;manual",
292+
"Newtonsoft.Json.Linq;JConstructor;false;set_Item;(System.Object,Newtonsoft.Json.Linq.JToken);;Argument[1];Argument[this].Element;value;manual",
293293
]
294294
}
295295
}
@@ -298,7 +298,7 @@ module JsonNET {
298298
private class NewtonsoftJsonLinqJContainerFlowModelCsv extends SummaryModelCsv {
299299
override predicate row(string row) {
300300
row =
301-
"Newtonsoft.Json.Linq;JContainer;true;Add;(System.Object);;Argument[0];Argument[Qualifier].Element;value;manual"
301+
"Newtonsoft.Json.Linq;JContainer;true;Add;(System.Object);;Argument[0];Argument[this].Element;value;manual"
302302
}
303303
}
304304
}

csharp/ql/lib/semmle/code/csharp/frameworks/ServiceStack.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,13 @@ private class ServiceStackXssSummaryModelCsv extends SummaryModelCsv {
282282
override predicate row(string row) {
283283
row =
284284
[
285-
"ServiceStack;HttpResult;false;HttpResult;(System.String,System.String);;Argument[0];Argument[Qualifier];taint;manual",
286-
"ServiceStack;HttpResult;false;HttpResult;(System.Object,System.String,System.Net.HttpStatusCode);;Argument[0];Argument[Qualifier];taint;manual",
287-
"ServiceStack;HttpResult;false;HttpResult;(System.Object,System.String);;Argument[0];Argument[Qualifier];taint;manual",
288-
"ServiceStack;HttpResult;false;HttpResult;(System.Object,System.Net.HttpStatusCode);;Argument[0];Argument[Qualifier];taint;manual",
289-
"ServiceStack;HttpResult;false;HttpResult;(System.Object);;Argument[0];Argument[Qualifier];taint;manual",
290-
"ServiceStack;HttpResult;false;HttpResult;(System.IO.Stream,System.String);;Argument[0];Argument[Qualifier];taint;manual",
291-
"ServiceStack;HttpResult;false;HttpResult;(System.Byte[],System.String);;Argument[0];Argument[Qualifier];taint;manual"
285+
"ServiceStack;HttpResult;false;HttpResult;(System.String,System.String);;Argument[0];Argument[this];taint;manual",
286+
"ServiceStack;HttpResult;false;HttpResult;(System.Object,System.String,System.Net.HttpStatusCode);;Argument[0];Argument[this];taint;manual",
287+
"ServiceStack;HttpResult;false;HttpResult;(System.Object,System.String);;Argument[0];Argument[this];taint;manual",
288+
"ServiceStack;HttpResult;false;HttpResult;(System.Object,System.Net.HttpStatusCode);;Argument[0];Argument[this];taint;manual",
289+
"ServiceStack;HttpResult;false;HttpResult;(System.Object);;Argument[0];Argument[this];taint;manual",
290+
"ServiceStack;HttpResult;false;HttpResult;(System.IO.Stream,System.String);;Argument[0];Argument[this];taint;manual",
291+
"ServiceStack;HttpResult;false;HttpResult;(System.Byte[],System.String);;Argument[0];Argument[this];taint;manual"
292292
]
293293
}
294294
}

csharp/ql/lib/semmle/code/csharp/frameworks/Sql.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ private class SqlCommandSummaryModelCsv extends SummaryModelCsv {
8383
row =
8484
[
8585
// SqlCommand
86-
"System.Data.SqlClient;SqlCommand;false;SqlCommand;(System.String);;Argument[0];Argument[Qualifier];taint;manual",
87-
"System.Data.SqlClient;SqlCommand;false;SqlCommand;(System.String,System.Data.SqlClient.SqlConnection);;Argument[0];Argument[Qualifier];taint;manual",
88-
"System.Data.SqlClient;SqlCommand;false;SqlCommand;(System.String,System.Data.SqlClient.SqlConnection,System.Data.SqlClient.SqlTransaction);;Argument[0];Argument[Qualifier];taint;manual",
86+
"System.Data.SqlClient;SqlCommand;false;SqlCommand;(System.String);;Argument[0];Argument[this];taint;manual",
87+
"System.Data.SqlClient;SqlCommand;false;SqlCommand;(System.String,System.Data.SqlClient.SqlConnection);;Argument[0];Argument[this];taint;manual",
88+
"System.Data.SqlClient;SqlCommand;false;SqlCommand;(System.String,System.Data.SqlClient.SqlConnection,System.Data.SqlClient.SqlTransaction);;Argument[0];Argument[this];taint;manual",
8989
// SQLiteCommand.
90-
"System.Data.SQLite;SQLiteCommand;false;SQLiteCommand;(System.String);;Argument[0];Argument[Qualifier];taint;manual",
91-
"System.Data.SQLite;SQLiteCommand;false;SQLiteCommand;(System.String,System.Data.SQLite.SQLiteConnection);;Argument[0];Argument[Qualifier];taint;manual",
92-
"System.Data.SQLite;SQLiteCommand;false;SQLiteCommand;(System.String,System.Data.SQLite.SQLiteConnection,System.Data.SQLite.SQLiteTransaction);;Argument[0];Argument[Qualifier];taint;manual",
90+
"System.Data.SQLite;SQLiteCommand;false;SQLiteCommand;(System.String);;Argument[0];Argument[this];taint;manual",
91+
"System.Data.SQLite;SQLiteCommand;false;SQLiteCommand;(System.String,System.Data.SQLite.SQLiteConnection);;Argument[0];Argument[this];taint;manual",
92+
"System.Data.SQLite;SQLiteCommand;false;SQLiteCommand;(System.String,System.Data.SQLite.SQLiteConnection,System.Data.SQLite.SQLiteTransaction);;Argument[0];Argument[this];taint;manual",
9393
]
9494
}
9595
}

0 commit comments

Comments
 (0)