C#: Autoformat

This commit is contained in:
Anders Schack-Mulligen
2023-02-17 12:20:25 +01:00
parent 730eae9521
commit 5ad7ed49dd
37 changed files with 226 additions and 114 deletions

View File

@@ -67,7 +67,8 @@ class MethodImplementation extends EntryPoint, @cil_method_implementation {
* destructors, operators, accessors and so on.
*/
class Method extends DotNet::Callable, Element, Member, TypeContainer, DataFlowNode,
CustomModifierReceiver, Parameterizable, @cil_method {
CustomModifierReceiver, Parameterizable, @cil_method
{
/**
* Gets a method implementation, if any. Note that there can
* be several implementations in different assemblies.

View File

@@ -302,7 +302,8 @@ class SystemType extends ValueOrRefType {
* ```
*/
class FunctionPointerType extends Type, CustomModifierReceiver, Parameterizable,
@cil_function_pointer_type {
@cil_function_pointer_type
{
/** Gets the return type of this function pointer. */
Type getReturnType() { cil_function_pointer_return_type(this, result) }

View File

@@ -15,7 +15,8 @@ private import TypeRef
* (`Property`), or an indexer (`Indexer`).
*/
class DeclarationWithAccessors extends AssignableMember, Virtualizable, Attributable,
@declaration_with_accessors {
@declaration_with_accessors
{
/** Gets an accessor of this declaration. */
Accessor getAnAccessor() { result.getDeclaration() = this }
@@ -49,7 +50,8 @@ class DeclarationWithAccessors extends AssignableMember, Virtualizable, Attribut
* property (`Property`) or an indexer (`Indexer`).
*/
class DeclarationWithGetSetAccessors extends DeclarationWithAccessors, TopLevelExprParent,
@assignable_with_accessors {
@assignable_with_accessors
{
/** Gets the `get` accessor of this declaration, if any. */
Getter getGetter() { result = this.getAnAccessor() }

View File

@@ -90,7 +90,8 @@ class LocalScopeVariable extends Variable, @local_scope_variable {
* ```
*/
class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, TopLevelExprParent,
@parameter {
@parameter
{
/**
* Gets the position of this parameter. For example, the position of `x` is
* 0 and the position of `y` is 1 in
@@ -376,7 +377,8 @@ class LocalConstant extends LocalVariable, @local_constant {
* ```
*/
class Field extends Variable, AssignableMember, Attributable, TopLevelExprParent, DotNet::Field,
@field {
@field
{
/**
* Gets the initial value of this field, if any. For example, the initial
* value of `F` on line 2 is `20` in

View File

@@ -172,7 +172,8 @@ private predicate isDoesNotReturnIfAttributeParameter(Parameter p, boolean value
* A method with a parameter that is annotated with
* `System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)`.
*/
class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertTrueMethod extends BooleanAssertMethod {
class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertTrueMethod extends BooleanAssertMethod
{
private int i_;
SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertTrueMethod() {
@@ -190,7 +191,8 @@ class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertTrueMethod exte
* A method with a parameter that is annotated with
* `System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(true)`.
*/
class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertFalseMethod extends BooleanAssertMethod {
class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertFalseMethod extends BooleanAssertMethod
{
private int i_;
SystemDiagnosticsCodeAnalysisDoesNotReturnIfAnnotatedAssertFalseMethod() {

View File

@@ -143,7 +143,8 @@ private class RecordConstructorFlow extends SummarizedCallable {
class RequiredSummaryComponentStack = Impl::Public::RequiredSummaryComponentStack;
private class RecordConstructorFlowRequiredSummaryComponentStack extends RequiredSummaryComponentStack {
private class RecordConstructorFlowRequiredSummaryComponentStack extends RequiredSummaryComponentStack
{
override predicate required(SummaryComponent head, SummaryComponentStack tail) {
exists(Property p |
recordConstructorFlow(_, _, p) and

View File

@@ -110,7 +110,8 @@ module Ssa {
/** A plain field or property. */
class PlainFieldOrPropSourceVariable extends FieldOrPropSourceVariable,
SsaImpl::TPlainFieldOrProp {
SsaImpl::TPlainFieldOrProp
{
override Callable getEnclosingCallable() { this = SsaImpl::TPlainFieldOrProp(result, _) }
override string toString() {
@@ -127,7 +128,8 @@ module Ssa {
/** A qualified field or property. */
class QualifiedFieldOrPropSourceVariable extends FieldOrPropSourceVariable,
SsaImpl::TQualifiedFieldOrProp {
SsaImpl::TQualifiedFieldOrProp
{
override Callable getEnclosingCallable() {
this = SsaImpl::TQualifiedFieldOrProp(result, _, _)
}

View File

@@ -1215,7 +1215,8 @@ private module ArgumentNodes {
* ```
*/
class ImplicitCapturedArgumentNode extends ArgumentNodeImpl, NodeImpl,
TImplicitCapturedArgumentNode {
TImplicitCapturedArgumentNode
{
private LocalScopeVariable v;
private ControlFlow::Nodes::ElementNode cfn;
@@ -2034,7 +2035,8 @@ private module PostUpdateNodes {
* a pre-update node for the `ObjectCreationNode`.
*/
class ObjectInitializerNode extends PostUpdateNode, NodeImpl, ArgumentNodeImpl,
TObjectInitializerNode {
TObjectInitializerNode
{
private ObjectCreation oc;
private ControlFlow::Nodes::ElementNode cfn;

View File

@@ -1115,7 +1115,8 @@ private module Internal {
/** A call using reflection. */
private class DispatchReflectionCall extends DispatchReflectionOrDynamicCall,
TDispatchReflectionCall {
TDispatchReflectionCall
{
override MethodCall getCall() { this = TDispatchReflectionCall(result, _, _, _, _) }
override string getName() { this = TDispatchReflectionCall(_, result, _, _, _) }
@@ -1163,7 +1164,8 @@ private module Internal {
/** A method call using dynamic types. */
private class DispatchDynamicMethodCall extends DispatchReflectionOrDynamicCall,
TDispatchDynamicMethodCall {
TDispatchDynamicMethodCall
{
override DynamicMethodCall getCall() { this = TDispatchDynamicMethodCall(result) }
override string getName() { result = this.getCall().getLateBoundTargetName() }
@@ -1184,7 +1186,8 @@ private module Internal {
/** An operator call using dynamic types. */
private class DispatchDynamicOperatorCall extends DispatchReflectionOrDynamicCall,
TDispatchDynamicOperatorCall {
TDispatchDynamicOperatorCall
{
override DynamicOperatorCall getCall() { this = TDispatchDynamicOperatorCall(result) }
override string getName() {
@@ -1201,7 +1204,8 @@ private module Internal {
/** A (potential) call to a property accessor using dynamic types. */
private class DispatchDynamicMemberAccess extends DispatchReflectionOrDynamicCall,
TDispatchDynamicMemberAccess {
TDispatchDynamicMemberAccess
{
override DynamicMemberAccess getCall() { this = TDispatchDynamicMemberAccess(result) }
override string getName() {
@@ -1225,7 +1229,8 @@ private module Internal {
/** A (potential) call to an indexer accessor using dynamic types. */
private class DispatchDynamicElementAccess extends DispatchReflectionOrDynamicCall,
TDispatchDynamicElementAccess {
TDispatchDynamicElementAccess
{
override DynamicElementAccess getCall() { this = TDispatchDynamicElementAccess(result) }
override string getName() {
@@ -1251,7 +1256,8 @@ private module Internal {
/** A (potential) call to an event accessor using dynamic types. */
private class DispatchDynamicEventAccess extends DispatchReflectionOrDynamicCall,
TDispatchDynamicEventAccess {
TDispatchDynamicEventAccess
{
override AssignArithmeticOperation getCall() {
this = TDispatchDynamicEventAccess(result, _, _)
}
@@ -1268,7 +1274,8 @@ private module Internal {
/** A call to a constructor using dynamic types. */
private class DispatchDynamicObjectCreation extends DispatchReflectionOrDynamicCall,
TDispatchDynamicObjectCreation {
TDispatchDynamicObjectCreation
{
override DynamicObjectCreation getCall() { this = TDispatchDynamicObjectCreation(result) }
override string getName() { none() }

View File

@@ -190,7 +190,8 @@ class DynamicAccess extends DynamicExpr {
* property, or an event).
*/
class DynamicMemberAccess extends DynamicAccess, MemberAccess, AssignableAccess,
@dynamic_member_access_expr {
@dynamic_member_access_expr
{
override string toString() {
result = "dynamic access to member " + this.getLateBoundTargetName()
}

View File

@@ -432,7 +432,8 @@ module EntityFramework {
}
}
private class DbContextSaveChangesRequiredSummaryComponentStack extends RequiredSummaryComponentStack {
private class DbContextSaveChangesRequiredSummaryComponentStack extends RequiredSummaryComponentStack
{
override predicate required(SummaryComponent head, SummaryComponentStack tail) {
exists(Content c | head = SummaryComponent::content(c) |
any(DbContextClass cls).requiresComponentStackIn(c, _, tail, _)

View File

@@ -74,7 +74,8 @@ class SystemDiagnosticsProcessClass extends SystemDiagnosticsClass {
}
/** The `System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute` class. */
class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAttributeClass extends SystemDiagnosticsCodeAnalysisClass {
class SystemDiagnosticsCodeAnalysisDoesNotReturnIfAttributeClass extends SystemDiagnosticsCodeAnalysisClass
{
SystemDiagnosticsCodeAnalysisDoesNotReturnIfAttributeClass() {
this.hasName("DoesNotReturnIfAttribute")
}

View File

@@ -33,7 +33,8 @@ class SystemCollectionsGenericUnboundGenericStruct extends UnboundGenericStruct
}
/** The `System.Collections.Generic.IComparer<>` interface. */
class SystemCollectionsGenericIComparerTInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIComparerTInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIComparerTInterface() { this.hasName("IComparer<>") }
/** Gets the `int Compare(T, T)` method. */
@@ -48,7 +49,8 @@ class SystemCollectionsGenericIComparerTInterface extends SystemCollectionsGener
}
/** The `System.Collections.Generic.IEqualityComparer<>` interface. */
class SystemCollectionsGenericIEqualityComparerTInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIEqualityComparerTInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIEqualityComparerTInterface() { this.hasName("IEqualityComparer<>") }
/** Gets the `bool Equals(T, T)` method. */
@@ -63,7 +65,8 @@ class SystemCollectionsGenericIEqualityComparerTInterface extends SystemCollecti
}
/** The `System.Collections.Generic.IEnumerable<>` interface. */
class SystemCollectionsGenericIEnumerableTInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIEnumerableTInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIEnumerableTInterface() {
this.hasName("IEnumerable<>") and
this.getNumberOfTypeParameters() = 1
@@ -71,7 +74,8 @@ class SystemCollectionsGenericIEnumerableTInterface extends SystemCollectionsGen
}
/** The `System.Collections.Generic.IEnumerator<>` interface. */
class SystemCollectionsGenericIEnumeratorInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIEnumeratorInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIEnumeratorInterface() {
this.hasName("IEnumerator<>") and
this.getNumberOfTypeParameters() = 1
@@ -86,7 +90,8 @@ class SystemCollectionsGenericIEnumeratorInterface extends SystemCollectionsGene
}
/** The `System.Collections.Generic.IList<>` interface. */
class SystemCollectionsGenericIListTInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIListTInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIListTInterface() {
this.hasName("IList<>") and
this.getNumberOfTypeParameters() = 1
@@ -102,7 +107,8 @@ class SystemCollectionsGenericListClass extends SystemCollectionsGenericUnboundG
}
/** The `System.Collections.Generic.KeyValuePair<,>` structure. */
class SystemCollectionsGenericKeyValuePairStruct extends SystemCollectionsGenericUnboundGenericStruct {
class SystemCollectionsGenericKeyValuePairStruct extends SystemCollectionsGenericUnboundGenericStruct
{
SystemCollectionsGenericKeyValuePairStruct() {
this.hasName("KeyValuePair<,>") and
this.getNumberOfTypeParameters() = 2
@@ -124,7 +130,8 @@ class SystemCollectionsGenericKeyValuePairStruct extends SystemCollectionsGeneri
}
/** The `System.Collections.Generic.ICollection<>` interface. */
class SystemCollectionsGenericICollectionInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericICollectionInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericICollectionInterface() { this.hasName("ICollection<>") }
/** Gets the `Count` property. */
@@ -138,12 +145,14 @@ class SystemCollectionsGenericICollectionInterface extends SystemCollectionsGene
}
/** The `System.Collections.Generic.IList<>` interface. */
class SystemCollectionsGenericIListInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIListInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIListInterface() { this.hasName("IList<>") }
}
/** The `System.Collections.Generic.IDictionary<>` interface. */
class SystemCollectionsGenericIDictionaryInterface extends SystemCollectionsGenericUnboundGenericInterface {
class SystemCollectionsGenericIDictionaryInterface extends SystemCollectionsGenericUnboundGenericInterface
{
SystemCollectionsGenericIDictionaryInterface() {
this.hasName("IDictionary<,>") and
this.getNumberOfTypeParameters() = 2

View File

@@ -19,6 +19,7 @@ class SystemCollectionsSpecializedClass extends Class {
}
/** The `System.Collections.Specialized.NameValueCollection` class. */
class SystemCollectionsSpecializedNameValueCollectionClass extends SystemCollectionsSpecializedClass {
class SystemCollectionsSpecializedNameValueCollectionClass extends SystemCollectionsSpecializedClass
{
SystemCollectionsSpecializedNameValueCollectionClass() { this.hasName("NameValueCollection") }
}

View File

@@ -20,7 +20,8 @@ class SystemRuntimeCompilerServicesNamespaceUnboundGenericStruct extends Unbound
}
/** The `System.Runtime.CompilerServices.TaskAwaiter<>` struct. */
class SystemRuntimeCompilerServicesTaskAwaiterStruct extends SystemRuntimeCompilerServicesNamespaceUnboundGenericStruct {
class SystemRuntimeCompilerServicesTaskAwaiterStruct extends SystemRuntimeCompilerServicesNamespaceUnboundGenericStruct
{
SystemRuntimeCompilerServicesTaskAwaiterStruct() { this.hasName("TaskAwaiter<>") }
/** Gets the `GetResult` method. */
@@ -31,7 +32,8 @@ class SystemRuntimeCompilerServicesTaskAwaiterStruct extends SystemRuntimeCompil
}
/** The `System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>` struct. */
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTStruct extends SystemRuntimeCompilerServicesNamespaceUnboundGenericStruct {
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTStruct extends SystemRuntimeCompilerServicesNamespaceUnboundGenericStruct
{
SystemRuntimeCompilerServicesConfiguredTaskAwaitableTStruct() {
this.hasName("ConfiguredTaskAwaitable<>")
}
@@ -55,7 +57,8 @@ private class SyntheticConfiguredTaskAwaiterField extends SyntheticField {
}
/** The `System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>.ConfiguredTaskAwaiter` struct. */
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterStruct extends Struct {
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterStruct extends Struct
{
SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterStruct() {
this = any(SystemRuntimeCompilerServicesConfiguredTaskAwaitableTStruct n).getANestedType() and
this.hasName("ConfiguredTaskAwaiter")

View File

@@ -22,7 +22,8 @@ class SystemSecurityCryptographyX509CertificatesClass extends Class {
* The `X509Certificate` or `X509Certificate2` class in the namespace
* `System.Security.Cryptography.X509Certificates`.
*/
class SystemSecurityCryptographyX509CertificatesX509CertificateClass extends SystemSecurityCryptographyX509CertificatesClass {
class SystemSecurityCryptographyX509CertificatesX509CertificateClass extends SystemSecurityCryptographyX509CertificatesClass
{
SystemSecurityCryptographyX509CertificatesX509CertificateClass() {
this.hasName("X509Certificate") or
this.hasName("X509Certificate2")

View File

@@ -299,7 +299,8 @@ private predicate isDataContractJsonSerializerCall(MethodCall mc, Method m) {
abstract private class DataContractJsonSerializerSink extends InstanceMethodSink { }
private class DataContractJsonSerializerDeserializeMethodSink extends DataContractJsonSerializerSink {
private class DataContractJsonSerializerDeserializeMethodSink extends DataContractJsonSerializerSink
{
DataContractJsonSerializerDeserializeMethodSink() {
exists(MethodCall mc |
isDataContractJsonSerializerCall(mc, _) and
@@ -308,7 +309,8 @@ private class DataContractJsonSerializerDeserializeMethodSink extends DataContra
}
}
private class DataContractJsonSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig {
private class DataContractJsonSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig
{
DataContractJsonSafeConstructorTrackingConfiguration() {
this = "DataContractJsonSafeConstructorTrackingConfiguration"
}
@@ -357,7 +359,8 @@ private class JavaScriptSerializerDeserializeMethodSink extends JavaScriptSerial
}
}
private class JavaScriptSerializerSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig {
private class JavaScriptSerializerSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig
{
JavaScriptSerializerSafeConstructorTrackingConfiguration() {
this = "JavaScriptSerializerSafeConstructorTrackingConfiguration"
}
@@ -400,7 +403,8 @@ private class XmlObjectSerializerDeserializeMethodSink extends XmlObjectSerializ
}
}
private class XmlObjectSerializerDerivedConstructorTrackingConfiguration extends SafeConstructorTrackingConfig {
private class XmlObjectSerializerDerivedConstructorTrackingConfiguration extends SafeConstructorTrackingConfig
{
XmlObjectSerializerDerivedConstructorTrackingConfiguration() {
this = "XmlObjectSerializerDerivedConstructorTrackingConfiguration"
}
@@ -445,7 +449,8 @@ private class XmlSerializerDeserializeMethodSink extends XmlSerializerSink {
}
}
private class XmlSerializerSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig {
private class XmlSerializerSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig
{
XmlSerializerSafeConstructorTrackingConfiguration() {
this = "XmlSerializerSafeConstructorTrackingConfiguration"
}
@@ -492,7 +497,8 @@ private class DataContractSerializerDeserializeMethodSink extends DataContractSe
}
}
private class DataContractSerializerSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig {
private class DataContractSerializerSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig
{
DataContractSerializerSafeConstructorTrackingConfiguration() {
this = "DataContractSerializerSafeConstructorTrackingConfiguration"
}
@@ -535,7 +541,8 @@ private class XmlMessageFormatterDeserializeMethodSink extends XmlMessageFormatt
}
}
private class XmlMessageFormatterSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig {
private class XmlMessageFormatterSafeConstructorTrackingConfiguration extends SafeConstructorTrackingConfig
{
XmlMessageFormatterSafeConstructorTrackingConfiguration() {
this = "XmlMessageFormatterSafeConstructorTrackingConfiguration"
}
@@ -717,7 +724,8 @@ private class SweetJaysonDeserializeMethodSink extends SweetJaysonSink {
/** ServiceStack.Text.JsonSerializer */
abstract private class ServiceStackTextJsonSerializerSink extends ConstructorOrStaticMethodSink { }
private class ServiceStackTextJsonSerializerDeserializeMethodSink extends ServiceStackTextJsonSerializerSink {
private class ServiceStackTextJsonSerializerDeserializeMethodSink extends ServiceStackTextJsonSerializerSink
{
ServiceStackTextJsonSerializerDeserializeMethodSink() {
exists(MethodCall mc, Method m |
m = mc.getTarget() and
@@ -741,7 +749,8 @@ private class ServiceStackTextJsonSerializerDeserializeMethodSink extends Servic
/** ServiceStack.Text.TypeSerializer */
abstract private class ServiceStackTextTypeSerializerSink extends ConstructorOrStaticMethodSink { }
private class ServiceStackTextTypeSerializerDeserializeMethodSink extends ServiceStackTextTypeSerializerSink {
private class ServiceStackTextTypeSerializerDeserializeMethodSink extends ServiceStackTextTypeSerializerSink
{
ServiceStackTextTypeSerializerDeserializeMethodSink() {
exists(MethodCall mc, Method m |
m = mc.getTarget() and
@@ -765,7 +774,8 @@ private class ServiceStackTextTypeSerializerDeserializeMethodSink extends Servic
/** ServiceStack.Text.CsvSerializer */
abstract private class ServiceStackTextCsvSerializerSink extends ConstructorOrStaticMethodSink { }
private class ServiceStackTextCsvSerializerDeserializeMethodSink extends ServiceStackTextCsvSerializerSink {
private class ServiceStackTextCsvSerializerDeserializeMethodSink extends ServiceStackTextCsvSerializerSink
{
ServiceStackTextCsvSerializerDeserializeMethodSink() {
exists(MethodCall mc, Method m |
m = mc.getTarget() and
@@ -789,7 +799,8 @@ private class ServiceStackTextCsvSerializerDeserializeMethodSink extends Service
/** ServiceStack.Text.XmlSerializer */
abstract private class ServiceStackTextXmlSerializerSink extends ConstructorOrStaticMethodSink { }
private class ServiceStackTextXmlSerializerDeserializeMethodSink extends ServiceStackTextXmlSerializerSink {
private class ServiceStackTextXmlSerializerDeserializeMethodSink extends ServiceStackTextXmlSerializerSink
{
ServiceStackTextXmlSerializerDeserializeMethodSink() {
exists(MethodCall mc, Method m |
m = mc.getTarget() and

View File

@@ -75,7 +75,8 @@ class AspNetQueryStringRemoteFlowSource extends AspNetRemoteFlowSource, DataFlow
/** A data flow source of remote user input (ASP.NET unvalidated request data). */
class AspNetUnvalidatedQueryStringRemoteFlowSource extends AspNetRemoteFlowSource,
DataFlow::ExprNode {
DataFlow::ExprNode
{
AspNetUnvalidatedQueryStringRemoteFlowSource() {
this.getExpr() = any(SystemWebUnvalidatedRequestValues c).getAProperty().getGetter().getACall() or
this.getExpr() =

View File

@@ -21,7 +21,8 @@ class TokenValidationParametersPropertySensitiveValidation extends Property {
/**
* A dataflow from a `false` value to a write sensitive property for `TokenValidationParameters`.
*/
class FalseValueFlowsToTokenValidationParametersPropertyWriteToBypassValidation extends DataFlow::Configuration {
class FalseValueFlowsToTokenValidationParametersPropertyWriteToBypassValidation extends DataFlow::Configuration
{
FalseValueFlowsToTokenValidationParametersPropertyWriteToBypassValidation() {
this = "FalseValueFlowsToTokenValidationParametersPropertyWriteToBypassValidation"
}
@@ -219,7 +220,8 @@ class CallableAlwaysReturnsParameter0 extends CallableReturnsStringAndArg0IsStri
/**
* A Callable that always return the 1st argument, both of `string` type. Higher precision
*/
class CallableAlwaysReturnsParameter0MayThrowExceptions extends CallableReturnsStringAndArg0IsString {
class CallableAlwaysReturnsParameter0MayThrowExceptions extends CallableReturnsStringAndArg0IsString
{
CallableAlwaysReturnsParameter0MayThrowExceptions() {
forex(Expr ret | this.canReturn(ret) |
ret = this.getParameter(0).getAnAccess()

View File

@@ -80,7 +80,8 @@ class DateTimeStruct extends Struct {
/**
* Dataflow configuration to find flow from a GetLastWriteTime source to a DateTime arithmetic operation
*/
private class FlowsFromGetLastWriteTimeConfigToTimeSpanArithmeticCallable extends TaintTracking::Configuration {
private class FlowsFromGetLastWriteTimeConfigToTimeSpanArithmeticCallable extends TaintTracking::Configuration
{
FlowsFromGetLastWriteTimeConfigToTimeSpanArithmeticCallable() {
this = "FlowsFromGetLastWriteTimeConfigToTimeSpanArithmeticCallable"
}
@@ -103,7 +104,8 @@ private class FlowsFromGetLastWriteTimeConfigToTimeSpanArithmeticCallable extend
/**
* Dataflow configuration to find flow from a DateTime arithmetic operation to a DateTime comparison operation
*/
private class FlowsFromTimeSpanArithmeticToTimeComparisonCallable extends TaintTracking::Configuration {
private class FlowsFromTimeSpanArithmeticToTimeComparisonCallable extends TaintTracking::Configuration
{
FlowsFromTimeSpanArithmeticToTimeComparisonCallable() {
this = "FlowsFromTimeSpanArithmeticToTimeComparisonCallable"
}
@@ -125,7 +127,8 @@ private class FlowsFromTimeSpanArithmeticToTimeComparisonCallable extends TaintT
/**
* Dataflow configuration to find flow from a DateTime comparison operation to a Selection Statement (such as an If)
*/
private class FlowsFromTimeComparisonCallableToSelectionStatementCondition extends TaintTracking::Configuration {
private class FlowsFromTimeComparisonCallableToSelectionStatementCondition extends TaintTracking::Configuration
{
FlowsFromTimeComparisonCallableToSelectionStatementCondition() {
this = "FlowsFromTimeComparisonCallableToSelectionStatementCondition"
}

View File

@@ -1082,7 +1082,8 @@ module Opcode {
* See the `CallSideEffectInstruction` documentation for more details.
*/
class CallSideEffect extends WriteSideEffectOpcode, EscapedWriteOpcode, MayWriteOpcode,
ReadSideEffectOpcode, EscapedReadOpcode, MayReadOpcode, TCallSideEffect {
ReadSideEffectOpcode, EscapedReadOpcode, MayReadOpcode, TCallSideEffect
{
final override string toString() { result = "CallSideEffect" }
}
@@ -1092,7 +1093,8 @@ module Opcode {
* See the `CallReadSideEffectInstruction` documentation for more details.
*/
class CallReadSideEffect extends ReadSideEffectOpcode, EscapedReadOpcode, MayReadOpcode,
TCallReadSideEffect {
TCallReadSideEffect
{
final override string toString() { result = "CallReadSideEffect" }
}
@@ -1102,7 +1104,8 @@ module Opcode {
* See the `IndirectReadSideEffectInstruction` documentation for more details.
*/
class IndirectReadSideEffect extends ReadSideEffectOpcode, IndirectReadOpcode,
TIndirectReadSideEffect {
TIndirectReadSideEffect
{
final override string toString() { result = "IndirectReadSideEffect" }
}
@@ -1112,7 +1115,8 @@ module Opcode {
* See the `IndirectMustWriteSideEffectInstruction` documentation for more details.
*/
class IndirectMustWriteSideEffect extends WriteSideEffectOpcode, IndirectWriteOpcode,
TIndirectMustWriteSideEffect {
TIndirectMustWriteSideEffect
{
final override string toString() { result = "IndirectMustWriteSideEffect" }
}
@@ -1122,7 +1126,8 @@ module Opcode {
* See the `IndirectMayWriteSideEffectInstruction` documentation for more details.
*/
class IndirectMayWriteSideEffect extends WriteSideEffectOpcode, IndirectWriteOpcode,
MayWriteOpcode, TIndirectMayWriteSideEffect {
MayWriteOpcode, TIndirectMayWriteSideEffect
{
final override string toString() { result = "IndirectMayWriteSideEffect" }
}
@@ -1132,7 +1137,8 @@ module Opcode {
* See the `BufferReadSideEffectInstruction` documentation for more details.
*/
class BufferReadSideEffect extends ReadSideEffectOpcode, UnsizedBufferReadOpcode,
TBufferReadSideEffect {
TBufferReadSideEffect
{
final override string toString() { result = "BufferReadSideEffect" }
}
@@ -1142,7 +1148,8 @@ module Opcode {
* See the `BufferMustWriteSideEffectInstruction` documentation for more details.
*/
class BufferMustWriteSideEffect extends WriteSideEffectOpcode, UnsizedBufferWriteOpcode,
TBufferMustWriteSideEffect {
TBufferMustWriteSideEffect
{
final override string toString() { result = "BufferMustWriteSideEffect" }
}
@@ -1152,7 +1159,8 @@ module Opcode {
* See the `BufferMayWriteSideEffectInstruction` documentation for more details.
*/
class BufferMayWriteSideEffect extends WriteSideEffectOpcode, UnsizedBufferWriteOpcode,
MayWriteOpcode, TBufferMayWriteSideEffect {
MayWriteOpcode, TBufferMayWriteSideEffect
{
final override string toString() { result = "BufferMayWriteSideEffect" }
}
@@ -1162,7 +1170,8 @@ module Opcode {
* See the `SizedBufferReadSideEffectInstruction` documentation for more details.
*/
class SizedBufferReadSideEffect extends ReadSideEffectOpcode, SizedBufferReadOpcode,
TSizedBufferReadSideEffect {
TSizedBufferReadSideEffect
{
final override string toString() { result = "SizedBufferReadSideEffect" }
}
@@ -1172,7 +1181,8 @@ module Opcode {
* See the `SizedBufferMustWriteSideEffectInstruction` documentation for more details.
*/
class SizedBufferMustWriteSideEffect extends WriteSideEffectOpcode, SizedBufferWriteOpcode,
TSizedBufferMustWriteSideEffect {
TSizedBufferMustWriteSideEffect
{
final override string toString() { result = "SizedBufferMustWriteSideEffect" }
}
@@ -1182,7 +1192,8 @@ module Opcode {
* See the `SizedBufferMayWriteSideEffectInstruction` documentation for more details.
*/
class SizedBufferMayWriteSideEffect extends WriteSideEffectOpcode, SizedBufferWriteOpcode,
MayWriteOpcode, TSizedBufferMayWriteSideEffect {
MayWriteOpcode, TSizedBufferMayWriteSideEffect
{
final override string toString() { result = "SizedBufferMayWriteSideEffect" }
}
@@ -1192,7 +1203,8 @@ module Opcode {
* See the `InitializeDynamicAllocationInstruction` documentation for more details.
*/
class InitializeDynamicAllocation extends SideEffectOpcode, EntireAllocationWriteOpcode,
TInitializeDynamicAllocation {
TInitializeDynamicAllocation
{
final override string toString() { result = "InitializeDynamicAllocation" }
}
@@ -1221,7 +1233,8 @@ module Opcode {
* See the `InlineAsmInstruction` documentation for more details.
*/
class InlineAsm extends Opcode, EscapedWriteOpcode, MayWriteOpcode, EscapedReadOpcode,
MayReadOpcode, TInlineAsm {
MayReadOpcode, TInlineAsm
{
final override string toString() { result = "InlineAsm" }
final override predicate hasOperandInternal(OperandTag tag) {

View File

@@ -28,7 +28,8 @@ abstract class TranslatedCondition extends ConditionBase {
}
abstract class TranslatedFlexibleCondition extends TranslatedCondition, ConditionContext,
TTranslatedFlexibleCondition {
TTranslatedFlexibleCondition
{
TranslatedFlexibleCondition() { this = TTranslatedFlexibleCondition(expr) }
final override TranslatedElement getChild(int id) { id = 0 and result = this.getOperand() }
@@ -156,7 +157,8 @@ class TranslatedLogicalOrExpr extends TranslatedBinaryLogicalOperation {
}
class TranslatedValueCondition extends TranslatedCondition, ValueConditionBase,
TTranslatedValueCondition {
TTranslatedValueCondition
{
TranslatedValueCondition() { this = TTranslatedValueCondition(expr) }
override TranslatedExpr getValueExpr() { result = getTranslatedExpr(expr) }

View File

@@ -40,7 +40,8 @@ abstract class TranslatedLocalDeclaration extends TranslatedElement, TTranslated
* including its initialization, if any.
*/
class TranslatedLocalVariableDeclaration extends TranslatedLocalDeclaration,
LocalVariableDeclarationBase, InitializationContext {
LocalVariableDeclarationBase, InitializationContext
{
LocalVariable var;
TranslatedLocalVariableDeclaration() { var = expr.getVariable() }

View File

@@ -119,7 +119,8 @@ abstract class TranslatedCoreExpr extends TranslatedExpr {
}
class TranslatedConditionValue extends TranslatedCoreExpr, ConditionContext,
TTranslatedConditionValue {
TTranslatedConditionValue
{
TranslatedConditionValue() { this = TTranslatedConditionValue(expr) }
override TranslatedElement getChild(int id) { id = 0 and result = this.getCondition() }
@@ -1950,7 +1951,8 @@ class TranslatedDelegateCall extends TranslatedNonConstantExpr {
* object is allocated, which is then initialized by the constructor.
*/
abstract class TranslatedCreation extends TranslatedCoreExpr, TTranslatedCreationExpr,
ConstructorCallContext {
ConstructorCallContext
{
TranslatedCreation() { this = TTranslatedCreationExpr(expr) }
override TranslatedElement getChild(int id) {

View File

@@ -276,7 +276,8 @@ abstract class TranslatedElementInitialization extends TranslatedElement {
* an explicit element in an initializer list.
*/
class TranslatedExplicitElementInitialization extends TranslatedElementInitialization,
TTranslatedExplicitElementInitialization, InitializationContext {
TTranslatedExplicitElementInitialization, InitializationContext
{
int elementIndex;
TranslatedExplicitElementInitialization() {
@@ -312,7 +313,8 @@ class TranslatedExplicitElementInitialization extends TranslatedElementInitializ
// TODO: Possibly refactor into something simpler
abstract class TranslatedConstructorCallFromConstructor extends TranslatedElement,
ConstructorCallContext {
ConstructorCallContext
{
Call call;
final override Language::AST getAst() { result = call }
@@ -344,7 +346,8 @@ TranslatedConstructorInitializer getTranslatedConstructorInitializer(Constructor
*/
// Review: do we need the conversion instructions in C#?
class TranslatedConstructorInitializer extends TranslatedConstructorCallFromConstructor,
TTranslatedConstructorInitializer {
TTranslatedConstructorInitializer
{
TranslatedConstructorInitializer() { this = TTranslatedConstructorInitializer(call) }
override string toString() { result = "constructor init: " + call.toString() }

View File

@@ -126,7 +126,8 @@ abstract class TranslatedCompilerGeneratedBlock extends TranslatedCompilerGenera
* the body of the `then` and the body of the `else`.
*/
abstract class TranslatedCompilerGeneratedIfStmt extends TranslatedCompilerGeneratedStmt,
ConditionContext {
ConditionContext
{
override Instruction getFirstInstruction() { result = getCondition().getFirstInstruction() }
override TranslatedElement getChild(int id) {

View File

@@ -45,7 +45,8 @@ module DelegateElements {
* The translation of the constructor call that happens as part of the delegate creation.
*/
private class TranslatedDelegateConstructorCall extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override DelegateCreation generatedBy;
TranslatedDelegateConstructorCall() { this = TTranslatedCompilerGeneratedElement(generatedBy, 0) }
@@ -80,7 +81,8 @@ private class TranslatedDelegateConstructorCall extends TranslatedCompilerGenera
* The translation of the invoke call that happens as part of the desugaring of the delegate call.
*/
private class TranslatedDelegateInvokeCall extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override DelegateCall generatedBy;
TranslatedDelegateInvokeCall() { this = TTranslatedCompilerGeneratedElement(generatedBy, 1) }

View File

@@ -64,7 +64,8 @@ module ForeachElements {
}
private class TranslatedForeachTry extends TranslatedCompilerGeneratedTry,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachTry() { this = TTranslatedCompilerGeneratedElement(generatedBy, 0) }
@@ -88,7 +89,8 @@ private class TranslatedForeachTry extends TranslatedCompilerGeneratedTry,
* The translation of the finally block.
*/
private class TranslatedForeachFinally extends TranslatedCompilerGeneratedBlock,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachFinally() { this = TTranslatedCompilerGeneratedElement(generatedBy, 1) }
@@ -108,7 +110,8 @@ private class TranslatedForeachFinally extends TranslatedCompilerGeneratedBlock,
* to correctly mark which edges should be back edges.
*/
class TranslatedForeachWhile extends TranslatedCompilerGeneratedStmt, ConditionContext,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachWhile() { this = TTranslatedCompilerGeneratedElement(generatedBy, 2) }
@@ -164,7 +167,8 @@ class TranslatedForeachWhile extends TranslatedCompilerGeneratedStmt, ConditionC
* The translation of the call to the `MoveNext` method, used as a condition for the while.
*/
private class TranslatedForeachMoveNext extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachMoveNext() { this = TTranslatedCompilerGeneratedElement(generatedBy, 3) }
@@ -192,7 +196,8 @@ private class TranslatedForeachMoveNext extends TranslatedCompilerGeneratedCall,
* The translation of the call to retrieve the enumerator.
*/
private class TranslatedForeachGetEnumerator extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachGetEnumerator() { this = TTranslatedCompilerGeneratedElement(generatedBy, 4) }
@@ -219,7 +224,8 @@ private class TranslatedForeachGetEnumerator extends TranslatedCompilerGenerated
* The translation of the call to the getter method of the `Current` property of the enumerator.
*/
private class TranslatedForeachCurrent extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachCurrent() { this = TTranslatedCompilerGeneratedElement(generatedBy, 5) }
@@ -247,7 +253,8 @@ private class TranslatedForeachCurrent extends TranslatedCompilerGeneratedCall,
* The translation of the call to dispose (inside the finally block)
*/
private class TranslatedForeachDispose extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachDispose() { this = TTranslatedCompilerGeneratedElement(generatedBy, 6) }
@@ -275,7 +282,8 @@ private class TranslatedForeachDispose extends TranslatedCompilerGeneratedCall,
* The condition for the while, ie. a call to MoveNext.
*/
private class TranslatedForeachWhileCondition extends TranslatedCompilerGeneratedValueCondition,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachWhileCondition() { this = TTranslatedCompilerGeneratedElement(generatedBy, 7) }
@@ -295,7 +303,8 @@ private class TranslatedForeachWhileCondition extends TranslatedCompilerGenerate
* declaration of the `temporary` enumerator variable)
*/
private class TranslatedForeachEnumerator extends TranslatedCompilerGeneratedDeclaration,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachEnumerator() { this = TTranslatedCompilerGeneratedElement(generatedBy, 8) }
@@ -323,7 +332,8 @@ private class TranslatedForeachEnumerator extends TranslatedCompilerGeneratedDec
* Class that represents that translation of the declaration that's happening inside the body of the while.
*/
private class TranslatedForeachIterVar extends TranslatedCompilerGeneratedDeclaration,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override ForeachStmt generatedBy;
TranslatedForeachIterVar() { this = TTranslatedCompilerGeneratedElement(generatedBy, 9) }
@@ -352,7 +362,8 @@ private class TranslatedForeachIterVar extends TranslatedCompilerGeneratedDeclar
* for the call to `MoveNext`.
*/
private class TranslatedMoveNextEnumAcc extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override ForeachStmt generatedBy;
TranslatedMoveNextEnumAcc() { this = TTranslatedCompilerGeneratedElement(generatedBy, 10) }
@@ -384,7 +395,8 @@ private class TranslatedMoveNextEnumAcc extends TTranslatedCompilerGeneratedElem
* for the call to the getter of the property `Current`.
*/
private class TranslatedForeachCurrentEnumAcc extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override ForeachStmt generatedBy;
TranslatedForeachCurrentEnumAcc() { this = TTranslatedCompilerGeneratedElement(generatedBy, 11) }
@@ -416,7 +428,8 @@ private class TranslatedForeachCurrentEnumAcc extends TTranslatedCompilerGenerat
* for the call to `Dispose`.
*/
private class TranslatedForeachDisposeEnumAcc extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override ForeachStmt generatedBy;
TranslatedForeachDisposeEnumAcc() { this = TTranslatedCompilerGeneratedElement(generatedBy, 12) }

View File

@@ -57,7 +57,8 @@ module LockElements {
* The translation of the `try` stmt.
*/
private class TranslatedLockTry extends TranslatedCompilerGeneratedTry,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedLockTry() { this = TTranslatedCompilerGeneratedElement(generatedBy, 0) }
@@ -81,7 +82,8 @@ private class TranslatedLockTry extends TranslatedCompilerGeneratedTry,
* The translation of the `lock` stmt's body.
*/
private class TranslatedLockTryBody extends TranslatedCompilerGeneratedBlock,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedLockTryBody() { this = TTranslatedCompilerGeneratedElement(generatedBy, 1) }
@@ -102,7 +104,8 @@ private class TranslatedLockTryBody extends TranslatedCompilerGeneratedBlock,
* The translation of the finally block.
*/
private class TranslatedLockFinally extends TranslatedCompilerGeneratedBlock,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedLockFinally() { this = TTranslatedCompilerGeneratedElement(generatedBy, 2) }
@@ -120,7 +123,8 @@ private class TranslatedLockFinally extends TranslatedCompilerGeneratedBlock,
* The translation of the call to dispose (inside the finally block)
*/
private class TranslatedMonitorExit extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedMonitorExit() { this = TTranslatedCompilerGeneratedElement(generatedBy, 3) }
@@ -152,7 +156,8 @@ private class TranslatedMonitorExit extends TranslatedCompilerGeneratedCall,
* The translation of the call to dispose (inside the finally block)
*/
private class TranslatedMonitorEnter extends TranslatedCompilerGeneratedCall,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedMonitorEnter() { this = TTranslatedCompilerGeneratedElement(generatedBy, 4) }
@@ -190,7 +195,8 @@ private class TranslatedMonitorEnter extends TranslatedCompilerGeneratedCall,
* The translation of the condition of the `if` present in the `finally` clause.
*/
private class TranslatedIfCondition extends TranslatedCompilerGeneratedValueCondition,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedIfCondition() { this = TTranslatedCompilerGeneratedElement(generatedBy, 5) }
@@ -209,7 +215,8 @@ private class TranslatedIfCondition extends TranslatedCompilerGeneratedValueCond
* The translation of the `if` stmt present in the `finally` clause.
*/
private class TranslatedFinallyIf extends TranslatedCompilerGeneratedIfStmt,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedFinallyIf() { this = TTranslatedCompilerGeneratedElement(generatedBy, 6) }
@@ -236,7 +243,8 @@ private class TranslatedFinallyIf extends TranslatedCompilerGeneratedIfStmt,
* bool temp variable.
*/
private class TranslatedWasTakenConst extends TranslatedCompilerGeneratedConstant,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedWasTakenConst() { this = TTranslatedCompilerGeneratedElement(generatedBy, 7) }
@@ -255,7 +263,8 @@ private class TranslatedWasTakenConst extends TranslatedCompilerGeneratedConstan
* Represents the translation of the `lockWasTaken` temp variable declaration.
*/
private class TranslatedLockWasTakenDecl extends TranslatedCompilerGeneratedDeclaration,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedLockWasTakenDecl() { this = TTranslatedCompilerGeneratedElement(generatedBy, 8) }
@@ -286,7 +295,8 @@ private class TranslatedLockWasTakenDecl extends TranslatedCompilerGeneratedDecl
* expression being locked.
*/
private class TranslatedLockedVarDecl extends TranslatedCompilerGeneratedDeclaration,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
override LockStmt generatedBy;
TranslatedLockedVarDecl() { this = TTranslatedCompilerGeneratedElement(generatedBy, 9) }
@@ -315,7 +325,8 @@ private class TranslatedLockedVarDecl extends TranslatedCompilerGeneratedDeclara
* Used as an argument for the `MonitorEnter` call.
*/
private class TranslatedMonitorEnterVarAcc extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override LockStmt generatedBy;
TranslatedMonitorEnterVarAcc() { this = TTranslatedCompilerGeneratedElement(generatedBy, 10) }
@@ -341,7 +352,8 @@ private class TranslatedMonitorEnterVarAcc extends TTranslatedCompilerGeneratedE
* Used as an argument for the `MonitorExit` call.
*/
private class TranslatedMonitorExitVarAcc extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override LockStmt generatedBy;
TranslatedMonitorExitVarAcc() { this = TTranslatedCompilerGeneratedElement(generatedBy, 11) }
@@ -366,7 +378,8 @@ private class TranslatedMonitorExitVarAcc extends TTranslatedCompilerGeneratedEl
* Used as an argument for the `MonitorEnter` call.
*/
private class TranslatedLockWasTakenCondVarAcc extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override LockStmt generatedBy;
TranslatedLockWasTakenCondVarAcc() { this = TTranslatedCompilerGeneratedElement(generatedBy, 12) }
@@ -391,7 +404,8 @@ private class TranslatedLockWasTakenCondVarAcc extends TTranslatedCompilerGenera
* as the `if` condition in the finally clause.
*/
private class TranslatedLockWasTakenRefArg extends TTranslatedCompilerGeneratedElement,
TranslatedCompilerGeneratedVariableAccess {
TranslatedCompilerGeneratedVariableAccess
{
override LockStmt generatedBy;
TranslatedLockWasTakenRefArg() { this = TTranslatedCompilerGeneratedElement(generatedBy, 13) }

View File

@@ -10,7 +10,8 @@ private import TranslatedCompilerGeneratedElement
private import experimental.ir.internal.IRCSharpLanguage as Language
abstract class TranslatedCompilerGeneratedCall extends TranslatedCallBase,
TranslatedCompilerGeneratedElement {
TranslatedCompilerGeneratedElement
{
final override string toString() {
result = "compiler generated call (" + generatedBy.toString() + ")"
}

View File

@@ -9,7 +9,8 @@ private import TranslatedCompilerGeneratedElement
private import experimental.ir.internal.IRCSharpLanguage as Language
abstract class TranslatedCompilerGeneratedValueCondition extends TranslatedCompilerGeneratedElement,
ValueConditionBase {
ValueConditionBase
{
final override string toString() {
result = "compiler generated condition (" + generatedBy.toString() + ")"
}

View File

@@ -16,7 +16,8 @@ private import experimental.ir.internal.CSharpType
private import experimental.ir.internal.IRCSharpLanguage as Language
abstract class TranslatedCompilerGeneratedDeclaration extends LocalVariableDeclarationBase,
TranslatedCompilerGeneratedElement {
TranslatedCompilerGeneratedElement
{
final override string toString() {
result = "compiler generated declaration (" + generatedBy.toString() + ")"
}

View File

@@ -7,7 +7,8 @@ private import experimental.ir.implementation.raw.internal.TranslatedElement
private import experimental.ir.internal.IRCSharpLanguage as Language
abstract class TranslatedCompilerGeneratedElement extends TranslatedElement,
TTranslatedCompilerGeneratedElement {
TTranslatedCompilerGeneratedElement
{
// The element that generates generated the compiler element can
// only be a stmt or an expr
ControlFlowElement generatedBy;

View File

@@ -10,7 +10,8 @@ private import experimental.ir.implementation.raw.internal.common.TranslatedExpr
private import experimental.ir.internal.IRCSharpLanguage as Language
abstract class TranslatedCompilerGeneratedExpr extends TranslatedCompilerGeneratedElement,
TranslatedExprBase {
TranslatedExprBase
{
override string toString() { result = "compiler generated expr (" + generatedBy.toString() + ")" }
abstract Type getResultType();

View File

@@ -6,7 +6,8 @@ private class IncludeAllSummarizedCallable extends IncludeSummarizedCallable {
IncludeAllSummarizedCallable() { exists(this) }
}
private class IncludeNeutralCallable extends RelevantNeutralCallable instanceof FlowSummaryImpl::Public::NeutralCallable {
private class IncludeNeutralCallable extends RelevantNeutralCallable instanceof FlowSummaryImpl::Public::NeutralCallable
{
/** Gets a string representing the callable in semi-colon separated format for use in flow summaries. */
final override string getCallableCsv() { result = Csv::asPartialNeutralModel(this) }
}

View File

@@ -2,7 +2,8 @@ import shared.FlowSummaries
private import semmle.code.csharp.dataflow.internal.DataFlowPrivate::Csv
private import semmle.code.csharp.dataflow.ExternalFlow
class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable instanceof SummarizedCallable {
class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable instanceof SummarizedCallable
{
/**
* Holds if flow is propagated between `input` and `output` and
* if there is no summary for a callable in a `base` class or interface

View File

@@ -2,8 +2,8 @@ import semmle.code.csharp.frameworks.EntityFramework::EntityFramework
import shared.FlowSummaries
import semmle.code.csharp.dataflow.ExternalFlow as ExternalFlow
private class IncludeEFSummarizedCallable extends IncludeSummarizedCallable instanceof EFSummarizedCallable {
}
private class IncludeEFSummarizedCallable extends IncludeSummarizedCallable instanceof EFSummarizedCallable
{ }
query predicate sourceNode(DataFlow::Node node, string kind) {
ExternalFlow::sourceNode(node, kind)