mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
rename all lower-case import-as statements
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
* Provides classes related to the namespace `System.Linq`.
|
||||
*/
|
||||
|
||||
private import csharp as csharp
|
||||
private import csharp as CSharp
|
||||
private import semmle.code.csharp.frameworks.System as System
|
||||
private import semmle.code.csharp.dataflow.ExternalFlow as ExternalFlow
|
||||
|
||||
/** Definitions relating to the `System.Linq` namespace. */
|
||||
module SystemLinq {
|
||||
/** The `System.Linq` namespace. */
|
||||
class Namespace extends csharp::Namespace {
|
||||
class Namespace extends CSharp::Namespace {
|
||||
Namespace() {
|
||||
this.getParentNamespace() instanceof System::SystemNamespace and
|
||||
this.hasUndecoratedName("Linq")
|
||||
@@ -17,7 +17,7 @@ module SystemLinq {
|
||||
}
|
||||
|
||||
/** A class in the `System.Linq` namespace. */
|
||||
class Class extends csharp::Class {
|
||||
class Class extends CSharp::Class {
|
||||
Class() { this.getNamespace() instanceof Namespace }
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ module SystemLinq {
|
||||
SystemLinqEnumerableClass() { this.hasName("Enumerable") }
|
||||
|
||||
/** Gets a `Count()` method. */
|
||||
csharp::ExtensionMethod getACountMethod() { result = this.getAMethod("Count<>") }
|
||||
CSharp::ExtensionMethod getACountMethod() { result = this.getAMethod("Count<>") }
|
||||
|
||||
/** Gets an `Any()` method. */
|
||||
csharp::ExtensionMethod getAnAnyMethod() { result = this.getAMethod("Any<>") }
|
||||
CSharp::ExtensionMethod getAnAnyMethod() { result = this.getAMethod("Any<>") }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* Provides classes related to the namespace `System.Data.Common`.
|
||||
*/
|
||||
|
||||
private import csharp as csharp
|
||||
private import csharp as CSharp
|
||||
private import semmle.code.csharp.frameworks.system.Data as Data
|
||||
private import semmle.code.csharp.dataflow.ExternalFlow as ExternalFlow
|
||||
|
||||
/** Definitions relating to the `System.Data.Common` namespace. */
|
||||
module SystemDataCommon {
|
||||
/** The `System.Data.Common` namespace. */
|
||||
class Namespace extends csharp::Namespace {
|
||||
class Namespace extends CSharp::Namespace {
|
||||
Namespace() {
|
||||
this.getParentNamespace() instanceof Data::SystemDataNamespace and
|
||||
this.hasName("Common")
|
||||
@@ -17,7 +17,7 @@ module SystemDataCommon {
|
||||
}
|
||||
|
||||
/** A class in the `System.Data.Common` namespace. */
|
||||
class Class extends csharp::Class {
|
||||
class Class extends CSharp::Class {
|
||||
Class() { this.getNamespace() instanceof Namespace }
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
* Provides classes related to the Entity Framework namespace `System.Data.Entity`.
|
||||
*/
|
||||
|
||||
private import csharp as csharp
|
||||
private import csharp as CSharp
|
||||
private import semmle.code.csharp.frameworks.system.Data as Data
|
||||
|
||||
/** Definitions relating to the `System.Data.Entity` namespace. */
|
||||
module SystemDataEntity {
|
||||
/** The `System.Data.Entity` namespace. */
|
||||
class Namespace extends csharp::Namespace {
|
||||
class Namespace extends CSharp::Namespace {
|
||||
Namespace() {
|
||||
this.getParentNamespace() instanceof Data::SystemDataNamespace and
|
||||
this.hasName("Entity")
|
||||
@@ -16,7 +16,7 @@ module SystemDataEntity {
|
||||
}
|
||||
|
||||
/** A class in the `System.Data.Entity` namespace. */
|
||||
class Class extends csharp::Class {
|
||||
class Class extends CSharp::Class {
|
||||
Class() { this.getNamespace() instanceof Namespace }
|
||||
}
|
||||
|
||||
@@ -25,28 +25,28 @@ module SystemDataEntity {
|
||||
Database() { this.hasName("Database") }
|
||||
|
||||
/** Gets the `ExecuteSqlCommand` method. */
|
||||
csharp::Method getExecuteSqlCommandMethod() { result = this.getAMethod("ExecuteSqlCommand") }
|
||||
CSharp::Method getExecuteSqlCommandMethod() { result = this.getAMethod("ExecuteSqlCommand") }
|
||||
|
||||
/** Gets the `ExecuteSqlCommandAsync` method. */
|
||||
csharp::Method getExecuteSqlCommandAsyncMethod() {
|
||||
CSharp::Method getExecuteSqlCommandAsyncMethod() {
|
||||
result = this.getAMethod("ExecuteSqlCommandAsync")
|
||||
}
|
||||
|
||||
/** Gets the `SqlQuery` method. */
|
||||
csharp::Method getSqlQueryMethod() { result = this.getAMethod("SqlQuery") }
|
||||
CSharp::Method getSqlQueryMethod() { result = this.getAMethod("SqlQuery") }
|
||||
}
|
||||
|
||||
/** The `System.Data.Entity.DbSet` class. */
|
||||
class DbSet extends Class {
|
||||
DbSet() {
|
||||
this.getUnboundDeclaration().(csharp::UnboundGenericClass).getUndecoratedName() = "DbSet"
|
||||
this.getUnboundDeclaration().(CSharp::UnboundGenericClass).getUndecoratedName() = "DbSet"
|
||||
}
|
||||
|
||||
/** Gets the `SqlQuery` method. */
|
||||
csharp::Method getSqlQueryMethod() { result = this.getAMethod("SqlQuery") }
|
||||
CSharp::Method getSqlQueryMethod() { result = this.getAMethod("SqlQuery") }
|
||||
|
||||
/** Gets the `DbSet` type, if any. */
|
||||
csharp::Type getDbSetType() { result = this.(csharp::ConstructedType).getTypeArgument(0) }
|
||||
CSharp::Type getDbSetType() { result = this.(CSharp::ConstructedType).getTypeArgument(0) }
|
||||
}
|
||||
|
||||
/** The `System.Data.Entity.DbContext` class. */
|
||||
@@ -55,23 +55,23 @@ module SystemDataEntity {
|
||||
}
|
||||
|
||||
/** A user provided sub type of `DbContext`. */
|
||||
class CustomDbContext extends csharp::Class {
|
||||
class CustomDbContext extends CSharp::Class {
|
||||
CustomDbContext() {
|
||||
this.fromSource() and
|
||||
this.getABaseType+() instanceof DbContext
|
||||
}
|
||||
|
||||
/** Gets a property that has the type `DbSet`. */
|
||||
csharp::Property getADbSetProperty() {
|
||||
CSharp::Property getADbSetProperty() {
|
||||
result = this.getAProperty() and
|
||||
result.getType() instanceof DbSet
|
||||
}
|
||||
}
|
||||
|
||||
/** An Entity Framework entity, as referenced from a `CustomDbContext`. */
|
||||
class Entity extends csharp::Class {
|
||||
class Entity extends CSharp::Class {
|
||||
Entity() {
|
||||
exists(CustomDbContext dbContext, csharp::Property p |
|
||||
exists(CustomDbContext dbContext, CSharp::Property p |
|
||||
p = dbContext.getADbSetProperty() and
|
||||
this = p.getType().(DbSet).getDbSetType()
|
||||
)
|
||||
@@ -82,7 +82,7 @@ module SystemDataEntity {
|
||||
/** Definitions relating to the `System.Data.Entity.Infrastructure` namespace. */
|
||||
module SystemDataEntityInfrastructure {
|
||||
/** The `System.Data.Entity.Infrastructure` namespace. */
|
||||
class Namespace extends csharp::Namespace {
|
||||
class Namespace extends CSharp::Namespace {
|
||||
Namespace() {
|
||||
this.getParentNamespace() instanceof SystemDataEntity::Namespace and
|
||||
this.hasName("Infrastructure")
|
||||
@@ -90,7 +90,7 @@ module SystemDataEntityInfrastructure {
|
||||
}
|
||||
|
||||
/** A class in the `System.Data.Entity.Infrastructure` namespace. */
|
||||
class Class extends csharp::Class {
|
||||
class Class extends CSharp::Class {
|
||||
Class() { this.getNamespace() instanceof Namespace }
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ module SystemDataEntityInfrastructure {
|
||||
DbRawSqlQuery() {
|
||||
this.getABaseType*()
|
||||
.getUnboundDeclaration()
|
||||
.(csharp::UnboundGenericClass)
|
||||
.(CSharp::UnboundGenericClass)
|
||||
.getUndecoratedName() = "DbRawSqlQuery"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
* Provides classes related to the namespace `System.Linq.Expressions`.
|
||||
*/
|
||||
|
||||
private import csharp as csharp
|
||||
private import csharp as CSharp
|
||||
private import semmle.code.csharp.frameworks.system.Linq
|
||||
|
||||
/** Definitions relating to the `System.Linq.Expressions` namespace. */
|
||||
module SystemLinqExpressions {
|
||||
/** The `System.Linq.Expressions` namespace. */
|
||||
class Namespace extends csharp::Namespace {
|
||||
class Namespace extends CSharp::Namespace {
|
||||
Namespace() {
|
||||
this.getParentNamespace() instanceof SystemLinq::Namespace and
|
||||
this.hasName("Expressions")
|
||||
@@ -16,12 +16,12 @@ module SystemLinqExpressions {
|
||||
}
|
||||
|
||||
/** A class in the `System.Linq.Expressions` namespace. */
|
||||
class Class extends csharp::Class {
|
||||
class Class extends CSharp::Class {
|
||||
Class() { this.getNamespace() instanceof Namespace }
|
||||
}
|
||||
|
||||
/** The `Expression<TDelegate>` class. */
|
||||
class ExpressionDelegate extends Class, csharp::UnboundGenericClass {
|
||||
class ExpressionDelegate extends Class, CSharp::UnboundGenericClass {
|
||||
ExpressionDelegate() { this.hasName("Expression<>") }
|
||||
}
|
||||
|
||||
@@ -30,20 +30,20 @@ module SystemLinqExpressions {
|
||||
* or a type of the form `Expression<T>`, where `T` is an actual
|
||||
* `delegate` type.
|
||||
*/
|
||||
class DelegateExtType extends csharp::Type {
|
||||
csharp::DelegateType dt;
|
||||
class DelegateExtType extends CSharp::Type {
|
||||
CSharp::DelegateType dt;
|
||||
|
||||
DelegateExtType() {
|
||||
this = dt
|
||||
or
|
||||
this =
|
||||
any(csharp::ConstructedClass cc |
|
||||
any(CSharp::ConstructedClass cc |
|
||||
cc.getUnboundGeneric() instanceof ExpressionDelegate and
|
||||
dt = cc.getTypeArgument(0)
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the underlying `delegate` type. */
|
||||
csharp::DelegateType getDelegateType() { result = dt }
|
||||
CSharp::DelegateType getDelegateType() { result = dt }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/** Provides classes related to the namespace `System.Xml.XPath`. */
|
||||
|
||||
import csharp as csharp
|
||||
private import semmle.code.csharp.frameworks.system.Xml as xml
|
||||
import csharp as CSharp
|
||||
private import semmle.code.csharp.frameworks.system.Xml as Xml
|
||||
|
||||
/** Definitions relating to the `System.Xml.XPath` namespace. */
|
||||
module SystemXmlXPath {
|
||||
/** The `System.Xml.XPath` namespace. */
|
||||
class Namespace extends csharp::Namespace {
|
||||
class Namespace extends CSharp::Namespace {
|
||||
Namespace() {
|
||||
this.getParentNamespace() instanceof xml::SystemXmlNamespace and
|
||||
this.getParentNamespace() instanceof Xml::SystemXmlNamespace and
|
||||
this.hasName("XPath")
|
||||
}
|
||||
}
|
||||
|
||||
/** A class in the `System.Xml.XPath` namespace. */
|
||||
class Class extends csharp::Class {
|
||||
class Class extends CSharp::Class {
|
||||
Class() { this.getNamespace() instanceof Namespace }
|
||||
}
|
||||
|
||||
@@ -28,17 +28,17 @@ module SystemXmlXPath {
|
||||
XPathNavigator() { this.hasName("XPathNavigator") }
|
||||
|
||||
/** Gets a method that selects nodes. */
|
||||
csharp::Method getASelectMethod() {
|
||||
CSharp::Method getASelectMethod() {
|
||||
result = this.getAMethod() and result.getName().matches("Select%")
|
||||
}
|
||||
|
||||
/** Gets the `Compile` method. */
|
||||
csharp::Method getCompileMethod() { result = this.getAMethod("Compile") }
|
||||
CSharp::Method getCompileMethod() { result = this.getAMethod("Compile") }
|
||||
|
||||
/** Gets an `Evaluate` method. */
|
||||
csharp::Method getAnEvaluateMethod() { result = this.getAMethod("Evaluate") }
|
||||
CSharp::Method getAnEvaluateMethod() { result = this.getAMethod("Evaluate") }
|
||||
|
||||
/** Gets a `Matches` method. */
|
||||
csharp::Method getAMatchesMethod() { result = this.getAMethod("Matches") }
|
||||
CSharp::Method getAMatchesMethod() { result = this.getAMethod("Matches") }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user