Skip to content

Commit 3f564a3

Browse files
committed
M14-6-1: Rename predicates for clarity
1 parent 82644bc commit 3f564a3

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private FunctionCall helper_functioncall(
3737
* Gets a function call in `TemplateClass` `t` where the target function name exists in a dependent
3838
* base type and the call is to a function that is not declared in the dependent base type.
3939
*/
40-
FunctionCall parentMemberFunctionCall(TemplateClass t) {
40+
FunctionCall getConfusingFunctionCall(TemplateClass t) {
4141
exists(
4242
string name, TemplateClass dependentBaseType, MemberFunction dependentTypeFunction,
4343
Function target
@@ -70,7 +70,7 @@ private FunctionAccess helper_functionaccess(
7070
* Gets a function access in `TemplateClass` `t` where the target function name exists in a dependent
7171
* base type and the access is to a function declared outside the dependent base type.
7272
*/
73-
FunctionAccess parentMemberFunctionAccess(TemplateClass t) {
73+
FunctionAccess getConfusingFunctionAccess(TemplateClass t) {
7474
exists(
7575
string name, TemplateClass dependentBaseType, MemberFunction dependentTypeFunction,
7676
Function target
@@ -101,7 +101,7 @@ private VariableAccess helper_memberaccess(
101101
* Gets a memmber access in `TemplateClass` `t` where the target member name exists in a dependent
102102
* base type and the access is to a variable declared outside the dependent base type.
103103
*/
104-
VariableAccess parentMemberAccess(TemplateClass t) {
104+
VariableAccess getConfusingMemberVariableAccess(TemplateClass t) {
105105
exists(
106106
string name, TemplateClass dependentBaseType, MemberVariable dependentTypeMemberVariable,
107107
Variable target

cpp/autosar/src/rules/M14-6-1/NameNotReferredUsingAQualifiedIdOrThis.ql

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ where
2424
not isCustomExcluded(fn) and
2525
missingNameQualifier(fn) and
2626
(
27-
fn instanceof FunctionAccess and
28-
fn = parentMemberFunctionAccess(c)
27+
fn = getConfusingFunctionAccess(c)
2928
or
30-
fn instanceof FunctionCall and
31-
fn = parentMemberFunctionCall(c) and
29+
fn = getConfusingFunctionCall(c) and
3230
not exists(Expr e | e = fn.(FunctionCall).getQualifier())
3331
or
34-
fn instanceof VariableAccess and
3532
not fn.(VariableAccess).getTarget() instanceof Parameter and
36-
fn = parentMemberAccess(c) and
33+
fn = getConfusingMemberVariableAccess(c) and
3734
not exists(Expr e | e = fn.(VariableAccess).getQualifier())
3835
) and
3936
not fn.isAffectedByMacro()

cpp/autosar/src/rules/M14-6-1/NameNotReferredUsingAQualifiedIdOrThisAudit.ql

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ where
2424
not isCustomExcluded(fn) and
2525
missingNameQualifier(fn) and
2626
(
27-
fn instanceof FunctionAccess and
28-
fn = parentMemberFunctionAccess(c)
27+
fn = getConfusingFunctionAccess(c)
2928
or
30-
fn instanceof FunctionCall and
31-
fn = parentMemberFunctionCall(c) and
29+
fn = getConfusingFunctionCall(c) and
3230
not exists(Expr e | e = fn.(FunctionCall).getQualifier())
3331
or
34-
fn instanceof VariableAccess and
3532
not fn.(VariableAccess).getTarget() instanceof Parameter and
36-
fn = parentMemberAccess(c) and
33+
fn = getConfusingMemberVariableAccess(c) and
3734
not exists(Expr e | e = fn.(VariableAccess).getQualifier())
3835
)
3936
select fn, "Use of identifier that also exists in a base class that is not fully qualified."

0 commit comments

Comments
 (0)