Skip to content

Commit 750cb2c

Browse files
committed
Add clickable links to the alert message
1 parent d4233c5 commit 750cb2c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cpp/common/src/codingstandards/cpp/rules/bitfieldsshouldnotbedeclared/BitFieldsShouldNotBeDeclared.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ signature module BitFieldsShouldNotBeDeclaredConfigSig {
1717
}
1818

1919
module BitFieldsShouldNotBeDeclared<BitFieldsShouldNotBeDeclaredConfigSig Config> {
20-
query predicate problems(BitField bf, Class c, string message) {
20+
query predicate problems(
21+
BitField bf, Class c, string message, Class linkLocation, string linkDescription
22+
) {
2123
/*
2224
* The condition that is allowed that is IF this is a bit-field, then it should be part of a class
2325
* that is flagged as a hardware or protocol class. To detect this we look for violations of that form.
@@ -26,7 +28,9 @@ module BitFieldsShouldNotBeDeclared<BitFieldsShouldNotBeDeclaredConfigSig Config
2628
not isExcluded(bf, Config::getQuery()) and
2729
not isExcluded(c, Config::getQuery()) and
2830
bf = c.getAField() and
31+
linkLocation = c and
32+
linkDescription = c.getName() and
2933
not c instanceof HardwareOrProtocolInterfaceClass and
30-
message = "Bit-field used within a class that is not a hardware or protocol class."
34+
message = "Bit-field used within a class $@ that is not a hardware or protocol class."
3135
}
3236
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cpp:57:8:57:8 | c | test.cpp:53:7:53:8 | B2 | Bit-field used within a class that is not a hardware or protocol class. |
1+
| test.cpp:57:8:57:8 | c | test.cpp:53:7:53:8 | B2 | Bit-field used within a class $@ that is not a hardware or protocol class. | test.cpp:53:7:53:8 | B2 | B2 |

0 commit comments

Comments
 (0)