-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathScope.json
More file actions
384 lines (384 loc) · 14.6 KB
/
Copy pathScope.json
File metadata and controls
384 lines (384 loc) · 14.6 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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
{
"AUTOSAR": {
"A17-6-1": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Adding declarations or definitions to standard namespaces or their sub-namespaces leads to undefined behavior.",
"kind": "problem",
"name": "Non-standard entities shall not be added to standard namespaces",
"precision": "very-high",
"severity": "error",
"short_name": "NonStandardEntitiesInStandardNamespaces",
"shared_implementation_short_name": "NonStandardEntitiesInStandardNamespaces",
"tags": [
"correctness"
]
}
],
"title": "Non-standard entities shall not be added to standard namespaces."
},
"A3-1-4": {
"properties": {
"allocated-target": [
"design",
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "A developer can more safely access the elements of an array if the size of the array can be explicitly determined.",
"kind": "problem",
"name": "When an array with external linkage is declared, its size shall be stated explicitly",
"precision": "very-high",
"severity": "warning",
"short_name": "ExternalLinkageArrayWithoutExplicitSizeAutosar",
"shared_implementation_short_name": "ExternalLinkageArrayWithoutExplicitSize",
"tags": [
"correctness"
]
}
],
"title": "When an array with external linkage is declared, its size shall be stated explicitly."
},
"A7-3-1": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "A non-overriding member function definition that hides an inherited member function can result in unexpected behavior.",
"kind": "problem",
"name": "Member function hides inherited member function",
"precision": "very-high",
"severity": "error",
"short_name": "HiddenInheritedNonOverridableMemberFunction",
"shared_implementation_short_name": "HiddenInheritedNonOverridableMemberFunction",
"tags": [
"correctness"
]
},
{
"description": "An overriding member function definition thats hides an overload of the overridden inherited member function can result in unexpected behavior.",
"kind": "problem",
"name": "Member function hides inherited member function",
"precision": "very-high",
"severity": "error",
"short_name": "HiddenInheritedOverridableMemberFunction",
"shared_implementation_short_name": "HiddenInheritedOverridableMemberFunction",
"tags": [
"correctness"
]
},
{
"description": "A using declaration that makes a symbol available for unqualified lookup does not included definitions defined after the using declaration which can result in unexpected behavior.",
"kind": "problem",
"name": "Using declaration followed by new definition",
"precision": "very-high",
"severity": "error",
"short_name": "DefinitionNotConsideredForUnqualifiedLookup",
"shared_implementation_short_name": "DefinitionNotConsideredForUnqualifiedLookup",
"tags": [
"correctness"
]
}
],
"title": "All overloads of a function shall be visible from where it is called."
},
"M3-2-2": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "The one-definition rule specifies when there should be a single definition of an element and a violation of that rule leads to undefined behavior.",
"kind": "problem",
"name": "The one-definition rule shall not be violated",
"precision": "medium",
"severity": "error",
"short_name": "OneDefinitionRuleViolation",
"shared_implementation_short_name": "OneDefinitionRuleViolation",
"tags": [
"correctness"
]
}
],
"title": "The one-definition rule shall not be violated."
},
"M3-2-3": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "A type, object or function that is used in multiple translation units shall be declared in one and only one file to prevent inconsistent declarations that can result in unexpected behavior.",
"kind": "problem",
"name": "A type, object or function that is used in multiple translation units shall be declared in a single file",
"precision": "high",
"severity": "warning",
"short_name": "MultipleDeclarationViolation",
"tags": [
"correctness"
]
}
],
"title": "A type, object or function that is used in multiple translation units shall be declared in one and only one file."
},
"M3-2-4": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "An identifier with multiple definitions in different translation units leads to undefined behavior.",
"kind": "problem",
"name": "An identifier with external linkage shall have exactly one definition",
"precision": "high",
"severity": "error",
"short_name": "IdentifierWithExternalLinkageShallHaveOneDefinition",
"shared_implementation_short_name": "IdentifierWithExternalLinkageOneDefinitionShared",
"tags": [
"correctness"
]
}
],
"title": "An identifier with external linkage shall have exactly one definition."
},
"M3-3-2": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "If a function has internal linkage then all re-declarations shall include the static storage class specifier to make the internal linkage explicit.",
"kind": "problem",
"name": "If a function has internal linkage then all re-declarations shall include the static storage class",
"precision": "very-high",
"severity": "warning",
"short_name": "MissingStaticSpecifierOnFunctionRedeclaration",
"shared_implementation_short_name": "MissingStaticSpecifierFunctionRedeclarationShared",
"tags": [
"readability"
]
}
],
"title": "If a function has internal linkage then all re-declarations shall include the static storage class specifier."
},
"M3-4-1": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "An identifier declared to be an object or type shall be defined in a block that minimizes its visibility to prevent any accidental use of the identifier.",
"kind": "problem",
"name": "An identifier declared to be an object or type shall be defined in a block that minimizes its visibility",
"precision": "high",
"severity": "warning",
"short_name": "UnnecessaryExposedIdentifierDeclaration",
"shared_implementation_short_name": "UnnecessaryExposedIdentifierDeclarationShared",
"tags": [
"correctness"
]
}
],
"title": "An identifier declared to be an object or type shall be defined in a block that minimizes its visibility."
},
"M7-3-1": {
"properties": {
"allocated-target": [
"implementation"
],
"enforcement": "automated",
"obligation": "required"
},
"queries": [
{
"description": "Declarations in the global namespace become part of the names found during lookup and reducing the set of found names ensures that they meet a developer's expectations.",
"kind": "problem",
"name": "The global namespace shall only contain main, namespace declarations and extern \"C\" declarations",
"precision": "very-high",
"severity": "warning",
"short_name": "GlobalNamespaceMembershipViolation",
"shared_implementation_short_name": "GlobalNamespaceDeclarations",
"tags": [
"readability"
]
}
],
"title": "The global namespace shall only contain main, namespace declarations and extern \"C\" declarations."
}
},
"CERT-C++": {
"DCL53-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Declaration of functions inside a function requires the use of ambiguous syntax that could lead to unintended behavior.",
"kind": "problem",
"name": "Declare functions in the global namespace or other namespace",
"precision": "very-high",
"severity": "warning",
"short_name": "LocalFunctionDeclaration",
"tags": [
"correctness",
"external/cert/severity/low",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/medium",
"external/cert/priority/p2",
"external/cert/level/l3"
]
},
{
"description": "An object declaration that declares an identifier that shadows an existing identifier relies on ambiguous syntax when initialized by a constructor and could lead to unintended behavior.",
"kind": "problem",
"name": "Do not declare local identifiers that shadow an in scope identifier",
"precision": "very-high",
"severity": "warning",
"short_name": "LocalConstructorInitializedObjectHidesIdentifier",
"tags": [
"correctness",
"external/cert/severity/low",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/medium",
"external/cert/priority/p2",
"external/cert/level/l3"
]
}
],
"title": "Do not write syntactically ambiguous declarations"
},
"DCL54-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Allocation and deallocation functions can be overloaded and not providing an overload of a corresponding dynamic storage function can result in improper deallocation of dynamically allocated memory leading to undefined behavior.",
"kind": "problem",
"name": "Overload allocation and deallocation functions as a pair in the same scope",
"precision": "very-high",
"severity": "error",
"short_name": "SingularOverloadOfMemoryFunction",
"tags": [
"correctness",
"external/cert/severity/low",
"external/cert/likelihood/probable",
"external/cert/remediation-cost/low",
"external/cert/priority/p6",
"external/cert/level/l2"
]
}
],
"title": "Overload allocation and deallocation functions as a pair in the same scope"
},
"DCL58-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Adding declarations or definitions to the standard namespaces leads to undefined behavior and is only allowed under special circumstances described in the C++ Standard.",
"kind": "problem",
"name": "Do not modify the standard namespaces",
"precision": "very-high",
"severity": "error",
"short_name": "ModificationOfTheStandardNamespaces",
"shared_implementation_short_name": "NonStandardEntitiesInStandardNamespaces",
"tags": [
"correctness",
"external/cert/severity/high",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/medium",
"external/cert/priority/p6",
"external/cert/level/l2"
]
}
],
"title": "Do not modify the standard namespaces"
},
"DCL59-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "Each translation unit has unique instances of members declared in an unnamed namespace leading to unexpected results, bloated executables, or undefined behavior due to one-definition rule violations if an unnamed namespace is introduced into translation units through a header file.",
"kind": "problem",
"name": "Do not define an unnamed namespace in a header file",
"precision": "very-high",
"severity": "error",
"short_name": "UnnamedNamespaceInHeaderFile",
"tags": [
"correctness",
"external/cert/severity/medium",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/medium",
"external/cert/priority/p4",
"external/cert/level/l3"
]
}
],
"title": "Do not define an unnamed namespace in a header file"
},
"DCL60-CPP": {
"properties": {
"obligation": "rule"
},
"queries": [
{
"description": "The one-definition rule specifies when there should be a single definition of an element and a violation of that rule leads to undefined behavior.",
"kind": "problem",
"name": "Obey the one-definition rule",
"precision": "medium",
"severity": "error",
"short_name": "OneDefinitionRuleNotObeyed",
"shared_implementation_short_name": "OneDefinitionRuleViolation",
"tags": [
"correctness",
"external/cert/severity/high",
"external/cert/likelihood/unlikely",
"external/cert/remediation-cost/high",
"external/cert/priority/p3",
"external/cert/level/l3"
]
}
],
"title": "Obey the one-definition rule"
}
}
}