Skip to content

Commit e5b9d15

Browse files
committed
M14-6-1: Re-name vars for clarity
1 parent 0d43de5 commit e5b9d15

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

cpp/autosar/src/rules/M14-6-1/NameInDependentBase.qll

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ TemplateClass getADependentBaseType(TemplateClass t) {
2222
* base type and the function does not call that function.
2323
*/
2424
FunctionCall parentMemberFunctionCall(TemplateClass t) {
25-
exists(TemplateClass dependentBaseType, MemberFunction parentFunction, Function other |
25+
exists(TemplateClass dependentBaseType, MemberFunction dependentTypeFunction, Function target |
2626
dependentBaseType = getADependentBaseType(t) and
27-
not other = parentFunction and
28-
dependentBaseType.getAMember() = parentFunction and
29-
other.getName() = parentFunction.getName() and
30-
result = other.getACallToThisFunction() and
27+
not target = dependentTypeFunction and
28+
dependentBaseType.getAMember() = dependentTypeFunction and
29+
target.getName() = dependentTypeFunction.getName() and
30+
result = target.getACallToThisFunction() and
3131
result.getEnclosingFunction() = t.getAMemberFunction()
3232
)
3333
}
@@ -37,12 +37,12 @@ FunctionCall parentMemberFunctionCall(TemplateClass t) {
3737
* as a `FunctionAccess` that exists in a child `MemberFunction`
3838
*/
3939
FunctionAccess parentMemberFunctionAccess(TemplateClass t) {
40-
exists(TemplateClass dependentBaseType, MemberFunction parentFunction, Function other |
40+
exists(TemplateClass dependentBaseType, MemberFunction dependentTypeFunction, Function target |
4141
dependentBaseType = getADependentBaseType(t) and
42-
not other = parentFunction and
43-
dependentBaseType.getAMember() = parentFunction and
44-
other.getName() = parentFunction.getName() and
45-
result = other.getAnAccess() and
42+
not target = dependentTypeFunction and
43+
dependentBaseType.getAMember() = dependentTypeFunction and
44+
target.getName() = dependentTypeFunction.getName() and
45+
result = target.getAnAccess() and
4646
result.getEnclosingFunction() = t.getAMemberFunction()
4747
)
4848
}
@@ -52,12 +52,14 @@ FunctionAccess parentMemberFunctionAccess(TemplateClass t) {
5252
* as a `VariableAccess` that exists in a child `MemberFunction`
5353
*/
5454
Access parentMemberAccess(TemplateClass t) {
55-
exists(TemplateClass dependentBaseType, MemberVariable parentMember, Variable other |
55+
exists(
56+
TemplateClass dependentBaseType, MemberVariable dependentTypeMemberVariable, Variable target
57+
|
5658
dependentBaseType = getADependentBaseType(t) and
57-
not other = parentMember and
58-
dependentBaseType.getAMemberVariable() = parentMember and
59-
other.getName() = parentMember.getName() and
60-
result = other.getAnAccess() and
59+
not target = dependentTypeMemberVariable and
60+
dependentBaseType.getAMemberVariable() = dependentTypeMemberVariable and
61+
target.getName() = dependentTypeMemberVariable.getName() and
62+
result = target.getAnAccess() and
6163
result.getEnclosingFunction() = t.getAMemberFunction()
6264
)
6365
}

0 commit comments

Comments
 (0)