Skip to content

Commit a7011e1

Browse files
committed
C#: Minor refactoring to avoid introducing name variable.
1 parent 72429cb commit a7011e1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

csharp/ql/lib/semmle/code/csharp/frameworks/microsoft/AspNetCore.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,8 @@ class MicrosoftAspNetCoreMvcControllerBaseClass extends Class {
196196
*/
197197
class MicrosoftAspNetCoreMvcController extends Class {
198198
MicrosoftAspNetCoreMvcController() {
199-
exists(Assembly a, string name |
200-
a.getName() = name and
201-
(
202-
name = "Microsoft.AspNetCore.Mvc.Core" or
203-
name = "Microsoft.AspNetCore.Mvc.ViewFeatures"
204-
)
199+
exists(Assembly a |
200+
a.getName() = ["Microsoft.AspNetCore.Mvc.Core", "Microsoft.AspNetCore.Mvc.ViewFeatures"]
205201
) and
206202
this.isPublic() and
207203
not this.isAbstract() and

csharp/ql/test/library-tests/frameworks/microsoft/AspNetCore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public string Index()
1010
}
1111

1212
// derived from Microsoft.AspNetCore.Mvc.Controller which has suffix "Controller"
13-
public class HomeController1 : Controller
13+
public class HomeController1 : Controller
1414
{
1515
public string Index()
1616
{
@@ -74,7 +74,7 @@ public string Index()
7474
}
7575
}
7676

77-
// contains generic paramiters
77+
// contains generic parameters
7878
public class NotHomeController3<T> : Controller
7979
{
8080
public string Index()

0 commit comments

Comments
 (0)