-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathDeadCode.json
More file actions
369 lines (369 loc) · 13 KB
/
DeadCode.json
File metadata and controls
369 lines (369 loc) · 13 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
{
"AUTOSAR": {
"A0-1-1": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "A project shall not contain instances of non-volatile variables being given values that are not subsequently used.",
"kind": "problem",
"name": "Non-volatile variable assigned a value which is never used",
"precision": "very-high",
"severity": "warning",
"short_name": "UselessAssignment",
"tags": [
"readability",
"maintainability"
]
}
],
"title": "A project shall not contain instances of non-volatile variables being given values that are not subsequently used."
},
"A0-1-2": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "The value returned by a function having a non-void return type that is not an overloaded operator shall be used.",
"kind": "problem",
"name": "Unused return value",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedReturnValue",
"shared_implementation_short_name": "UnusedReturnValueShared",
"tags": [
"readability",
"maintainability"
]
}
],
"title": "The value returned by a function having a non-void return type that is not an overloaded operator shall be used."
},
"A0-1-3": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Every function defined in an anonymous namespace, or static function with internal linkage, or private member function shall be used.",
"kind": "problem",
"name": "Unused local function",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedLocalFunction",
"tags": [
"readability",
"maintainability"
],
"implementation_scope": {
"description": "Use of any overload of a function in an overload set constitute a use of all members of the set. An overload set is a set of functions with the same name that differ in the number, type and/or qualifiers of their parameters, and, for the purpose of this query, are limited to functions which are declared in the same scope (namespace or class). Functions defined in anonymous (unnamed) namespaces and global namespaces are therefore not currently considered to be part of the same overload set."
}
}
],
"title": "Every function defined in an anonymous namespace, or static function with internal linkage, or private member function shall be used."
},
"A0-1-4": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Unused parameters can indicate a mistake when implementing the function.",
"kind": "problem",
"name": "There shall be no unused named parameters in non-virtual functions",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedParameter",
"tags": [
"readability",
"maintainability"
],
"shared_implementation_short_name": "UnusedParameter"
}
],
"title": "There shall be no unused named parameters in non-virtual functions."
},
"A0-1-5": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "There shall be no unused named parameters in the set of parameters for a virtual function and all the functions that override it.",
"kind": "problem",
"name": "There shall be no unused named parameters in virtual functions",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedVirtualParameter",
"tags": [
"readability",
"maintainability"
]
}
],
"title": "There shall be no unused named parameters in the set of parameters for a virtual function and all the functions that override it."
},
"A0-1-6": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "advisory"
},
"queries": [
{
"description": "Unused type declarations are either redundant or indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "There should be no unused type declarations",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedTypeDeclarations",
"tags": [
"readability",
"maintainability"
],
"shared_implementation_short_name": "UnusedTypeDeclarations"
}
],
"title": "There should be no unused type declarations."
},
"M0-1-1": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Unreachable code complicates the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain unreachable code",
"precision": "very-high",
"severity": "warning",
"short_name": "UnreachableCode",
"tags": [
"readability",
"maintainability"
],
"shared_implementation_short_name": "UnreachableCode"
}
],
"title": "A project shall not contain unreachable code."
},
"M0-1-10": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "advisory"
},
"queries": [
{
"description": "Uncalled functions complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "Every defined function should be called at least once",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedFunction",
"tags": [
"readability",
"maintainability"
]
},
{
"description": "Uncalled functions complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "Every defined function should be called at least once",
"precision": "medium",
"severity": "warning",
"short_name": "UnusedSplMemberFunction",
"tags": [
"readability",
"maintainability"
],
"implementation_scope": {
"description": "In limited cases, this query can raise false-positives for special member function calls invoked from the C++ Metaprogramming library."
}
}
],
"title": "Every defined function should be called at least once."
},
"M0-1-2": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Infeasible paths complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain infeasible paths",
"precision": "high",
"severity": "warning",
"short_name": "InfeasiblePath",
"tags": [
"readability",
"maintainability"
]
}
],
"title": "A project shall not contain infeasible paths."
},
"M0-1-3": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Unused variables complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain unused local variables",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedLocalVariable",
"tags": [
"readability",
"maintainability"
],
"implementation_scope": {
"description": "In limited cases, this query can raise false-positives for variables that are defined as constexpr and used in an expression to instantiate a template."
}
},
{
"description": "Unused variables complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain unused global and namespace variables",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedGlobalOrNamespaceVariable",
"tags": [
"readability",
"maintainability"
],
"implementation_scope": {
"description": "This query will not report unused global or namespace variables generated from a macro expansion. The rationale is that a macro may not use all variables in all expansions."
}
},
{
"description": "Unused variables complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain unused member variables",
"precision": "very-high",
"severity": "warning",
"short_name": "UnusedMemberVariable",
"tags": [
"readability",
"maintainability"
]
}
],
"title": "A project shall not contain unused variables."
},
"M0-1-4": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Single use local POD variables complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain non-volatile local POD variables having only one use",
"precision": "very-high",
"severity": "warning",
"short_name": "SingleUseLocalPODVariable",
"tags": [
"readability",
"maintainability"
]
},
{
"description": "Single use global or namespace POD variables complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain non-volatile global or namespace POD variables having only one use",
"precision": "very-high",
"severity": "warning",
"short_name": "SingleUseGlobalOrNamespacePODVariable",
"tags": [
"readability",
"maintainability"
]
},
{
"description": "Single use member POD variables complicate the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "A project shall not contain non-volatile member POD variables having only one use",
"precision": "very-high",
"severity": "warning",
"short_name": "SingleUseMemberPODVariable",
"tags": [
"readability",
"maintainability"
]
}
],
"title": "A project shall not contain non-volatile POD variables having only one use."
},
"M0-1-9": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Dead code complicates the program and can indicate a possible mistake on the part of the programmer.",
"kind": "problem",
"name": "There shall be no dead code",
"precision": "very-high",
"severity": "warning",
"short_name": "DeadCode",
"tags": [
"readability",
"maintainability"
],
"shared_implementation_short_name": "DeadCode"
}
],
"title": "There shall be no dead code."
}
}
}