forked from github/codeql-coding-standards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderOfEvaluation.qll
More file actions
131 lines (122 loc) · 5.04 KB
/
OrderOfEvaluation.qll
File metadata and controls
131 lines (122 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//** THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY. **/
import cpp
import RuleMetadata
import codingstandards.cpp.exclusions.RuleMetadata
newtype OrderOfEvaluationQuery =
TExpressionShouldNotRelyOnOrderOfEvaluationQuery() or
TOperandsOfALogicalAndOrNotParenthesizedQuery() or
TExplicitConstructionOfUnnamedTemporaryQuery() or
TGratuitousUseOfParenthesesQuery() or
TInsufficientUseOfParenthesesQuery() or
TIncrementAndDecrementOperatorsMixedWithOtherOperatorsInExpressionQuery() or
TAssignmentInSubExpressionQuery()
predicate isOrderOfEvaluationQueryMetadata(
Query query, string queryId, string ruleId, string category
) {
query =
// `Query` instance for the `expressionShouldNotRelyOnOrderOfEvaluation` query
OrderOfEvaluationPackage::expressionShouldNotRelyOnOrderOfEvaluationQuery() and
queryId =
// `@id` for the `expressionShouldNotRelyOnOrderOfEvaluation` query
"cpp/autosar/expression-should-not-rely-on-order-of-evaluation" and
ruleId = "A5-0-1" and
category = "required"
or
query =
// `Query` instance for the `operandsOfALogicalAndOrNotParenthesized` query
OrderOfEvaluationPackage::operandsOfALogicalAndOrNotParenthesizedQuery() and
queryId =
// `@id` for the `operandsOfALogicalAndOrNotParenthesized` query
"cpp/autosar/operands-of-a-logical-and-or-not-parenthesized" and
ruleId = "A5-2-6" and
category = "required"
or
query =
// `Query` instance for the `explicitConstructionOfUnnamedTemporary` query
OrderOfEvaluationPackage::explicitConstructionOfUnnamedTemporaryQuery() and
queryId =
// `@id` for the `explicitConstructionOfUnnamedTemporary` query
"cpp/autosar/explicit-construction-of-unnamed-temporary" and
ruleId = "A6-2-2" and
category = "required"
or
query =
// `Query` instance for the `gratuitousUseOfParentheses` query
OrderOfEvaluationPackage::gratuitousUseOfParenthesesQuery() and
queryId =
// `@id` for the `gratuitousUseOfParentheses` query
"cpp/autosar/gratuitous-use-of-parentheses" and
ruleId = "M5-0-2" and
category = "advisory"
or
query =
// `Query` instance for the `insufficientUseOfParentheses` query
OrderOfEvaluationPackage::insufficientUseOfParenthesesQuery() and
queryId =
// `@id` for the `insufficientUseOfParentheses` query
"cpp/autosar/insufficient-use-of-parentheses" and
ruleId = "M5-0-2" and
category = "advisory"
or
query =
// `Query` instance for the `incrementAndDecrementOperatorsMixedWithOtherOperatorsInExpression` query
OrderOfEvaluationPackage::incrementAndDecrementOperatorsMixedWithOtherOperatorsInExpressionQuery() and
queryId =
// `@id` for the `incrementAndDecrementOperatorsMixedWithOtherOperatorsInExpression` query
"cpp/autosar/increment-and-decrement-operators-mixed-with-other-operators-in-expression" and
ruleId = "M5-2-10" and
category = "required"
or
query =
// `Query` instance for the `assignmentInSubExpression` query
OrderOfEvaluationPackage::assignmentInSubExpressionQuery() and
queryId =
// `@id` for the `assignmentInSubExpression` query
"cpp/autosar/assignment-in-sub-expression" and
ruleId = "M6-2-1" and
category = "required"
}
module OrderOfEvaluationPackage {
Query expressionShouldNotRelyOnOrderOfEvaluationQuery() {
//autogenerate `Query` type
result =
// `Query` type for `expressionShouldNotRelyOnOrderOfEvaluation` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TExpressionShouldNotRelyOnOrderOfEvaluationQuery()))
}
Query operandsOfALogicalAndOrNotParenthesizedQuery() {
//autogenerate `Query` type
result =
// `Query` type for `operandsOfALogicalAndOrNotParenthesized` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TOperandsOfALogicalAndOrNotParenthesizedQuery()))
}
Query explicitConstructionOfUnnamedTemporaryQuery() {
//autogenerate `Query` type
result =
// `Query` type for `explicitConstructionOfUnnamedTemporary` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TExplicitConstructionOfUnnamedTemporaryQuery()))
}
Query gratuitousUseOfParenthesesQuery() {
//autogenerate `Query` type
result =
// `Query` type for `gratuitousUseOfParentheses` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TGratuitousUseOfParenthesesQuery()))
}
Query insufficientUseOfParenthesesQuery() {
//autogenerate `Query` type
result =
// `Query` type for `insufficientUseOfParentheses` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TInsufficientUseOfParenthesesQuery()))
}
Query incrementAndDecrementOperatorsMixedWithOtherOperatorsInExpressionQuery() {
//autogenerate `Query` type
result =
// `Query` type for `incrementAndDecrementOperatorsMixedWithOtherOperatorsInExpression` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TIncrementAndDecrementOperatorsMixedWithOtherOperatorsInExpressionQuery()))
}
Query assignmentInSubExpressionQuery() {
//autogenerate `Query` type
result =
// `Query` type for `assignmentInSubExpression` query
TQueryCPP(TOrderOfEvaluationPackageQuery(TAssignmentInSubExpressionQuery()))
}
}