Skip to content

Commit e61a5fe

Browse files
Minor alert message improvement
1 parent 7ef9f80 commit e61a5fe

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

cpp/misra/src/rules/RULE-10-2-2/UnscopedEnumerationsShouldNotBeDeclared.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ where
2828
not (enum instanceof ScopedEnum or enum instanceof NestedUnscopedEnum) and
2929
(
3030
if enum.isAnonymous()
31-
then
32-
message = "This unnamed enumeration is an unscoped and not enclosed in a class or a struct."
33-
else message = "This enumeration $@ is an unscoped enum not enclosed in a class or a struct."
31+
then message = "Unnamed enumeration is unscoped and not enclosed in a class or a struct."
32+
else
33+
message = "Enum " + enum.getName() + " is unscoped and not enclosed in a class or a struct."
3434
)
35-
select enum, message, enum, enum.toString()
35+
select enum, message
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
| test.cpp:8:6:8:14 | E_Global1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:8:6:8:14 | E_Global1 | E_Global1 |
2-
| test.cpp:13:6:13:6 | (unnamed enum) | This unnamed enumeration is an unscoped and not enclosed in a class or a struct. | test.cpp:13:6:13:6 | (unnamed enum) | (unnamed enum) |
3-
| test.cpp:23:6:23:7 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:23:6:23:7 | E1 | E1 |
4-
| test.cpp:24:6:24:6 | (unnamed enum) | This unnamed enumeration is an unscoped and not enclosed in a class or a struct. | test.cpp:24:6:24:6 | (unnamed enum) | (unnamed enum) |
5-
| test.cpp:30:6:30:7 | E3 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:30:6:30:7 | E3 | E3 |
6-
| test.cpp:33:6:33:7 | E4 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:33:6:33:7 | E4 | E4 |
7-
| test.cpp:40:6:40:12 | E_Anon1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:40:6:40:12 | E_Anon1 | E_Anon1 |
8-
| test.cpp:44:6:44:6 | (unnamed enum) | This unnamed enumeration is an unscoped and not enclosed in a class or a struct. | test.cpp:44:6:44:6 | (unnamed enum) | (unnamed enum) |
9-
| test.cpp:56:6:56:7 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:56:6:56:7 | E1 | E1 |
10-
| test.cpp:99:6:99:7 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:99:6:99:7 | E1 | E1 |
11-
| test.cpp:114:8:114:9 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:114:8:114:9 | E1 | E1 |
12-
| test.cpp:115:8:115:8 | (unnamed enum) | This unnamed enumeration is an unscoped and not enclosed in a class or a struct. | test.cpp:115:8:115:8 | (unnamed enum) | (unnamed enum) |
13-
| test.cpp:126:10:126:11 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:126:10:126:11 | E1 | E1 |
14-
| test.cpp:129:10:129:11 | E2 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:129:10:129:11 | E2 | E2 |
15-
| test.cpp:132:12:132:13 | E3 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:132:12:132:13 | E3 | E3 |
16-
| test.cpp:158:8:158:9 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:158:8:158:9 | E1 | E1 |
17-
| test.cpp:159:8:159:8 | (unnamed enum) | This unnamed enumeration is an unscoped and not enclosed in a class or a struct. | test.cpp:159:8:159:8 | (unnamed enum) | (unnamed enum) |
18-
| test.cpp:166:8:166:9 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:166:8:166:9 | E1 | E1 |
19-
| test.cpp:169:10:169:11 | E2 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:169:10:169:11 | E2 | E2 |
20-
| test.cpp:178:10:178:11 | E1 | This enumeration $@ is an unscoped enum not enclosed in a class or a struct. | test.cpp:178:10:178:11 | E1 | E1 |
1+
| test.cpp:8:6:8:14 | E_Global1 | Enum E_Global1 is unscoped and not enclosed in a class or a struct. |
2+
| test.cpp:13:6:13:6 | (unnamed enum) | Unnamed enumeration is unscoped and not enclosed in a class or a struct. |
3+
| test.cpp:23:6:23:7 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
4+
| test.cpp:24:6:24:6 | (unnamed enum) | Unnamed enumeration is unscoped and not enclosed in a class or a struct. |
5+
| test.cpp:30:6:30:7 | E3 | Enum E3 is unscoped and not enclosed in a class or a struct. |
6+
| test.cpp:33:6:33:7 | E4 | Enum E4 is unscoped and not enclosed in a class or a struct. |
7+
| test.cpp:40:6:40:12 | E_Anon1 | Enum E_Anon1 is unscoped and not enclosed in a class or a struct. |
8+
| test.cpp:44:6:44:6 | (unnamed enum) | Unnamed enumeration is unscoped and not enclosed in a class or a struct. |
9+
| test.cpp:56:6:56:7 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
10+
| test.cpp:99:6:99:7 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
11+
| test.cpp:114:8:114:9 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
12+
| test.cpp:115:8:115:8 | (unnamed enum) | Unnamed enumeration is unscoped and not enclosed in a class or a struct. |
13+
| test.cpp:126:10:126:11 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
14+
| test.cpp:129:10:129:11 | E2 | Enum E2 is unscoped and not enclosed in a class or a struct. |
15+
| test.cpp:132:12:132:13 | E3 | Enum E3 is unscoped and not enclosed in a class or a struct. |
16+
| test.cpp:158:8:158:9 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
17+
| test.cpp:159:8:159:8 | (unnamed enum) | Unnamed enumeration is unscoped and not enclosed in a class or a struct. |
18+
| test.cpp:166:8:166:9 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |
19+
| test.cpp:169:10:169:11 | E2 | Enum E2 is unscoped and not enclosed in a class or a struct. |
20+
| test.cpp:178:10:178:11 | E1 | Enum E1 is unscoped and not enclosed in a class or a struct. |

0 commit comments

Comments
 (0)