Skip to content

Commit 27efb0d

Browse files
committed
C#: Rename -> for .
1 parent 29ccac8 commit 27efb0d

File tree

34 files changed

+144
-144
lines changed

34 files changed

+144
-144
lines changed

csharp/ql/lib/semmle/code/asp/AspNet.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ class PageDirective extends AspDirective {
185185
* Gets the 'CodeBehind' class from which this page inherits.
186186
*/
187187
ValueOrRefType getInheritedType() {
188-
exists(string namespace, string type |
189-
result.hasQualifiedName(namespace, type) and
190-
splitQualifiedName(this.getInheritedTypeQualifiedName(), namespace, type)
188+
exists(string qualifier, string type |
189+
result.hasQualifiedName(qualifier, type) and
190+
splitQualifiedName(this.getInheritedTypeQualifiedName(), qualifier, type)
191191
)
192192
}
193193

csharp/ql/lib/semmle/code/cil/ConsistencyChecks.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,11 @@ class InvalidOverride extends MethodViolation {
485485
}
486486

487487
override string getMessage() {
488-
exists(string namespace, string type |
489-
base.getDeclaringType().hasQualifiedName(namespace, type)
488+
exists(string qualifier, string type |
489+
base.getDeclaringType().hasQualifiedName(qualifier, type)
490490
|
491491
result =
492-
"Overridden method from " + getQualifiedName(namespace, type) + " is not in a base type"
492+
"Overridden method from " + getQualifiedName(qualifier, type) + " is not in a base type"
493493
)
494494
}
495495
}

csharp/ql/lib/semmle/code/cil/Type.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class Type extends DotNet::Type, Declaration, TypeContainer, @cil_type {
5151
*/
5252
Type getUnboundType() { cil_type(this, _, _, _, result) }
5353

54-
override predicate hasQualifiedName(string namespace, string name) {
54+
override predicate hasQualifiedName(string qualifier, string name) {
5555
name = this.getName() and
56-
exists(string pnamespace, string pname | this.getParent().hasQualifiedName(pnamespace, pname) |
57-
namespace = getQualifiedName(pnamespace, pname)
56+
exists(string pqualifier, string pname | this.getParent().hasQualifiedName(pqualifier, pname) |
57+
qualifier = getQualifiedName(pqualifier, pname)
5858
)
5959
}
6060

csharp/ql/lib/semmle/code/cil/Variable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Variable extends DotNet::Variable, Declaration, DataFlowNode, @cil_variabl
2929

3030
/** A stack variable. Either a local variable (`LocalVariable`) or a parameter (`Parameter`). */
3131
class StackVariable extends Variable, @cil_stack_variable {
32-
override predicate hasQualifiedName(string namespace, string name) { none() }
32+
override predicate hasQualifiedName(string qualifier, string name) { none() }
3333
}
3434

3535
/**

csharp/ql/lib/semmle/code/csharp/Callable.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ class Operator extends Callable, Member, Attributable, @operator {
456456

457457
override Parameter getRawParameter(int i) { result = this.getParameter(i) }
458458

459-
override predicate hasQualifiedName(string namespace, string name) {
460-
super.hasQualifiedName(namespace, _) and
459+
override predicate hasQualifiedName(string qualifier, string name) {
460+
super.hasQualifiedName(qualifier, _) and
461461
name = this.getFunctionName()
462462
}
463463

@@ -1001,10 +1001,10 @@ class LocalFunction extends Callable, Modifiable, Attributable, @local_function
10011001

10021002
override Callable getEnclosingCallable() { result = this.getStatement().getEnclosingCallable() }
10031003

1004-
override predicate hasQualifiedName(string namespace, string name) {
1005-
exists(string cnamespace, string type |
1006-
this.getEnclosingCallable().hasQualifiedName(cnamespace, type) and
1007-
namespace = getQualifiedName(cnamespace, type)
1004+
override predicate hasQualifiedName(string qualifier, string name) {
1005+
exists(string cqualifier, string type |
1006+
this.getEnclosingCallable().hasQualifiedName(cqualifier, type) and
1007+
qualifier = getQualifiedName(cqualifier, type)
10081008
) and
10091009
name = this.getName()
10101010
}

csharp/ql/lib/semmle/code/csharp/Generics.qll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ private string getTypeArgumentsNames(ConstructedGeneric cg) {
100100

101101
bindingset[t]
102102
private string getFullName(Type t) {
103-
exists(string namespace, string name |
104-
t.hasQualifiedName(namespace, name) and
105-
result = getQualifiedName(namespace, name)
103+
exists(string qualifier, string name |
104+
t.hasQualifiedName(qualifier, name) and
105+
result = getQualifiedName(qualifier, name)
106106
)
107107
}
108108

@@ -159,15 +159,15 @@ class UnboundGenericType extends ValueOrRefType, UnboundGeneric {
159159
result = this.getUndecoratedName() + "<" + getTypeParameterCommas(this) + ">"
160160
}
161161

162-
final override predicate hasQualifiedName(string namespace, string name) {
162+
final override predicate hasQualifiedName(string qualifier, string name) {
163163
exists(string name0 | name = name0 + "<" + getTypeParameterCommas(this) + ">" |
164164
exists(string enclosing |
165-
this.getDeclaringType().hasQualifiedName(namespace, enclosing) and
165+
this.getDeclaringType().hasQualifiedName(qualifier, enclosing) and
166166
name0 = enclosing + "+" + this.getUndecoratedName()
167167
)
168168
or
169169
not exists(this.getDeclaringType()) and
170-
namespace = this.getNamespace().getFullName() and
170+
qualifier = this.getNamespace().getFullName() and
171171
name0 = this.getUndecoratedName()
172172
)
173173
}
@@ -237,8 +237,8 @@ class TypeParameter extends DotNet::TypeParameter, Type, @type_parameter {
237237
/** Gets the generic that defines this type parameter. */
238238
UnboundGeneric getGeneric() { type_parameters(this, _, result, _) }
239239

240-
final override predicate hasQualifiedName(string namespace, string name) {
241-
namespace = "" and
240+
final override predicate hasQualifiedName(string qualifier, string name) {
241+
qualifier = "" and
242242
name = this.getName()
243243
}
244244

@@ -424,15 +424,15 @@ class ConstructedType extends ValueOrRefType, ConstructedGeneric {
424424
result = this.getUndecoratedName() + "<" + getTypeArgumentsNames(this) + ">"
425425
}
426426

427-
final override predicate hasQualifiedName(string namespace, string name) {
427+
final override predicate hasQualifiedName(string qualifier, string name) {
428428
exists(string name0 | name = name0 + "<" + getTypeArgumentsQualifiedNames(this) + ">" |
429429
exists(string enclosing |
430-
this.getDeclaringType().hasQualifiedName(namespace, enclosing) and
430+
this.getDeclaringType().hasQualifiedName(qualifier, enclosing) and
431431
name0 = enclosing + "+" + this.getUndecoratedName()
432432
)
433433
or
434434
not exists(this.getDeclaringType()) and
435-
namespace = this.getNamespace().getFullName() and
435+
qualifier = this.getNamespace().getFullName() and
436436
name0 = this.getUndecoratedName()
437437
)
438438
}

csharp/ql/lib/semmle/code/csharp/Type.qll

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ private predicate isObjectClass(Class c) { c instanceof ObjectType }
5757
*/
5858
class ValueOrRefType extends DotNet::ValueOrRefType, Type, Attributable, @value_or_ref_type {
5959
/**
60-
* Holds if this type has the qualified name `namespace`.`name`.
60+
* Holds if this type has the qualified name `qualifier`.`name`.
6161
*
6262
* For example the class `System.IO.IOException` has
63-
* `namespace`=`System.IO` and `name`=`IOException`.
63+
* `qualifier`=`System.IO` and `name`=`IOException`.
6464
*/
65-
override predicate hasQualifiedName(string namespace, string name) {
65+
override predicate hasQualifiedName(string qualifier, string name) {
6666
exists(string enclosing |
67-
this.getDeclaringType().hasQualifiedName(namespace, enclosing) and
67+
this.getDeclaringType().hasQualifiedName(qualifier, enclosing) and
6868
name = enclosing + "+" + this.getUndecoratedName()
6969
)
7070
or
7171
not exists(this.getDeclaringType()) and
72-
namespace = this.getNamespace().getFullName() and
72+
qualifier = this.getNamespace().getFullName() and
7373
name = this.getUndecoratedName()
7474
}
7575

@@ -398,8 +398,8 @@ class NonNestedType extends ValueOrRefType {
398398
* The `void` type.
399399
*/
400400
class VoidType extends DotNet::ValueOrRefType, Type, @void_type {
401-
override predicate hasQualifiedName(string namespace, string name) {
402-
namespace = "System" and
401+
override predicate hasQualifiedName(string qualifier, string name) {
402+
qualifier = "System" and
403403
name = "Void"
404404
}
405405

@@ -1007,8 +1007,8 @@ class NullableType extends ValueType, DotNet::ConstructedGeneric, @nullable_type
10071007
result = "Nullable<" + this.getUnderlyingType().getName() + ">"
10081008
}
10091009

1010-
final override predicate hasQualifiedName(string namespace, string name) {
1011-
namespace = "System" and
1010+
final override predicate hasQualifiedName(string qualifier, string name) {
1011+
qualifier = "System" and
10121012
name = "Nullable<" + this.getUnderlyingType().getQualifiedName() + ">"
10131013
}
10141014
}
@@ -1076,9 +1076,9 @@ class ArrayType extends DotNet::ArrayType, RefType, @array_type {
10761076
result = this.getElementType().getALocation()
10771077
}
10781078

1079-
final override predicate hasQualifiedName(string namespace, string name) {
1079+
final override predicate hasQualifiedName(string qualifier, string name) {
10801080
exists(Type elementType, string name0 |
1081-
elementType.hasQualifiedName(namespace, name0) and
1081+
elementType.hasQualifiedName(qualifier, name0) and
10821082
name = name0 + this.getDimensionString(elementType)
10831083
)
10841084
}
@@ -1106,9 +1106,9 @@ class PointerType extends DotNet::PointerType, Type, @pointer_type {
11061106

11071107
override string getAPrimaryQlClass() { result = "PointerType" }
11081108

1109-
final override predicate hasQualifiedName(string namespace, string name) {
1109+
final override predicate hasQualifiedName(string qualifier, string name) {
11101110
exists(string name0 |
1111-
this.getReferentType().hasQualifiedName(namespace, name0) and
1111+
this.getReferentType().hasQualifiedName(qualifier, name0) and
11121112
name = name0 + "*"
11131113
)
11141114
}
@@ -1190,8 +1190,8 @@ class TupleType extends ValueType, @tuple_type {
11901190

11911191
override Type getChild(int i) { result = this.getUnderlyingType().getChild(i) }
11921192

1193-
final override predicate hasQualifiedName(string namespace, string name) {
1194-
this.getUnderlyingType().hasQualifiedName(namespace, name)
1193+
final override predicate hasQualifiedName(string qualifier, string name) {
1194+
this.getUnderlyingType().hasQualifiedName(qualifier, name)
11951195
}
11961196

11971197
override string getAPrimaryQlClass() { result = "TupleType" }

csharp/ql/lib/semmle/code/csharp/Variable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class LocalScopeVariable extends Variable, @local_scope_variable {
7171
*/
7272
predicate isRef() { none() }
7373

74-
override predicate hasQualifiedName(string namespace, string name) { none() }
74+
override predicate hasQualifiedName(string qualifier, string name) { none() }
7575
}
7676

7777
/**

csharp/ql/lib/semmle/code/csharp/commons/QualifiedName.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
*/
44

55
/**
6-
* Returns the concatenation of `namespace` and `name`, separated by a dot.
6+
* Returns the concatenation of `qualifier` and `name`, separated by a dot.
77
*/
8-
bindingset[namespace, name]
9-
string getQualifiedName(string namespace, string name) {
10-
if namespace = "" then result = name else result = namespace + "." + name
8+
bindingset[qualifier, name]
9+
string getQualifiedName(string qualifier, string name) {
10+
if qualifier = "" then result = name else result = qualifier + "." + name
1111
}
1212

1313
/**

csharp/ql/lib/semmle/code/csharp/frameworks/system/security/cryptography/SymmetricAlgorithm.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
import csharp
66

77
/**
8-
* Holds if the object creation `oc` is the creation of the reference type with the specified `namespace` and `type`, or a class derived from
9-
* the class with the specified `namespace` and `type`.
8+
* Holds if the object creation `oc` is the creation of the reference type with the specified `qualifier` and `type`, or a class derived from
9+
* the class with the specified `qualifier` and `type`.
1010
*/
11-
private predicate isCreatingObject(ObjectCreation oc, string namespace, string type) {
12-
exists(RefType t | t = oc.getType() | t.getBaseClass*().hasQualifiedName(namespace, type))
11+
private predicate isCreatingObject(ObjectCreation oc, string qualifier, string type) {
12+
exists(RefType t | t = oc.getType() | t.getBaseClass*().hasQualifiedName(qualifier, type))
1313
}
1414

1515
/**
16-
* Holds if the method call `mc` is returning the reference type with the specified `namespace` and `type`.
16+
* Holds if the method call `mc` is returning the reference type with the specified `qualifier` and `type`.
1717
* and the target of the method call is a library method.
1818
*/
19-
private predicate isReturningObject(MethodCall mc, string namespace, string type) {
19+
private predicate isReturningObject(MethodCall mc, string qualifier, string type) {
2020
mc.getTarget().fromLibrary() and
21-
exists(RefType t | t = mc.getType() | t.hasQualifiedName(namespace, type))
21+
exists(RefType t | t = mc.getType() | t.hasQualifiedName(qualifier, type))
2222
}
2323

2424
/**

0 commit comments

Comments
 (0)