C#: Minor refactoring to avoid introducing name variable.

This commit is contained in:
Michael Nebel
2022-07-25 09:48:21 +02:00
parent 72429cb9e8
commit a7011e11c4
2 changed files with 4 additions and 8 deletions

View File

@@ -196,12 +196,8 @@ class MicrosoftAspNetCoreMvcControllerBaseClass extends Class {
*/
class MicrosoftAspNetCoreMvcController extends Class {
MicrosoftAspNetCoreMvcController() {
exists(Assembly a, string name |
a.getName() = name and
(
name = "Microsoft.AspNetCore.Mvc.Core" or
name = "Microsoft.AspNetCore.Mvc.ViewFeatures"
)
exists(Assembly a |
a.getName() = ["Microsoft.AspNetCore.Mvc.Core", "Microsoft.AspNetCore.Mvc.ViewFeatures"]
) and
this.isPublic() and
not this.isAbstract() and

View File

@@ -10,7 +10,7 @@ public class HomeController
}
// derived from Microsoft.AspNetCore.Mvc.Controller which has suffix "Controller"
public class HomeController1 : Controller
public class HomeController1 : Controller
{
public string Index()
{
@@ -74,7 +74,7 @@ public abstract class NotHomeController2 : Controller
}
}
// contains generic paramiters
// contains generic parameters
public class NotHomeController3<T> : Controller
{
public string Index()