Skip to content

Commit 17e6b2a

Browse files
authored
Merge pull request #10557 from erik-krogh/csharp-followMsg
C#: Update the alert messages to better follow the style guide
2 parents 292bc67 + e2fe63f commit 17e6b2a

File tree

92 files changed

+402
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+402
-396
lines changed

csharp/ql/campaigns/Solorigate/src/ModifiedFnvFunctionDetection.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ where
2727
xor2.getAnOperand() = v.getAnAccess()
2828
)
2929
)
30-
select l,
31-
"The variable $@ seems to be used as part of a FNV-like hash calculation, that is modified by an additional $@ expression using literal $@.",
32-
v, v.toString(), additional_xor, "xor", l, l.toString()
30+
select l, "This literal is used in an $@ after an FNV-like hash calculation with variable $@.",
31+
additional_xor, "additional xor", v, v.toString()

csharp/ql/campaigns/Solorigate/src/NumberOfKnownCommandsAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ where
3434
total = countSolorigateCommandInEnum(e) and
3535
total > 10
3636
select e,
37-
"The enum $@ may be related to Solorigate. It matches " + total +
38-
" of the values used for commands in the enum.", e, e.getName()
37+
"This enum may be related to Solorigate. It matches " + total +
38+
" of the values used for commands in the enum."

csharp/ql/campaigns/Solorigate/src/NumberOfKnownHashesAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ where
2929
isSolorigateHash(l) and
3030
total > threshold
3131
select l,
32-
"The Hash literal $@ may be related to the Solorigate campaign. Total count = " + total +
33-
" is above the threshold " + threshold + ".", l, l.getValue()
32+
"This Hash literal may be related to the Solorigate campaign. Total count = " + total +
33+
" is above the threshold " + threshold + "."

csharp/ql/campaigns/Solorigate/src/NumberOfKnownLiteralsAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ where
2929
isSolorigateLiteral(l) and
3030
total > threshold
3131
select l,
32-
"The literal $@ may be related to the Solorigate campaign. Total count = " + total +
33-
" is above the threshold " + threshold + ".", l, l.getValue()
32+
"This literal may be related to the Solorigate campaign. Total count = " + total +
33+
" is above the threshold " + threshold + "."

csharp/ql/campaigns/Solorigate/src/NumberOfKnownMethodNamesAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ where
2828
isSolorigateSuspiciousMethodName(m) and
2929
total > threshold
3030
select m,
31-
"The method $@ may be related to Solorigate. Total count = " + total + " is above the threshold " +
32-
threshold + ".", m, m.getName()
31+
"This method may be related to Solorigate. Total count = " + total + " is above the threshold " +
32+
threshold + "."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cs:39:16:39:36 | 6605813339339102567 | The variable $@ seems to be used as part of a FNV-like hash calculation, that is modified by an additional $@ expression using literal $@. | test.cs:25:9:25:11 | num | num | test.cs:39:10:39:36 | ... ^ ... | xor | test.cs:39:16:39:36 | 6605813339339102567 | 6605813339339102567 |
1+
| test.cs:39:16:39:36 | 6605813339339102567 | This literal is used in an $@ after a FNV-like hash calculation with variable $@. | test.cs:39:10:39:36 | ... ^ ... | additional xor | test.cs:25:9:25:11 | num | num |

csharp/ql/src/API Abuse/ClassDoesNotImplementEquals.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ where
2323
exists(MethodCall callToEquals |
2424
callToEquals.getTarget() instanceof EqualsMethod and
2525
callToEquals.getQualifier().getType() = c and
26-
message = "but it is called $@" and
26+
message = "but $@" and
2727
item = callToEquals and
28-
itemText = "here"
28+
itemText = "'Equals' is called on an instance of this class"
2929
)
3030
or
3131
item = c.getAnOperator().(EQOperator) and

csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ predicate mayNotBeDisposed(LocalScopeDisposableCreation disposable) {
106106

107107
from LocalScopeDisposableCreation disposable
108108
where mayNotBeDisposed(disposable)
109-
select disposable, "Disposable '" + disposable.getType() + "' is created here but is not disposed."
109+
select disposable, "Disposable '" + disposable.getType() + "' is created but not disposed."

csharp/ql/src/CSI/NullAlways.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ import semmle.code.csharp.dataflow.Nullness
1616

1717
from Dereference d, Ssa::SourceVariable v
1818
where d.isFirstAlwaysNull(v)
19-
select d, "Variable $@ is always null here.", v, v.toString()
19+
select d, "Variable $@ is always null at this dereference.", v, v.toString()

csharp/ql/src/CSI/NullMaybe.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ import PathGraph
1919
from
2020
Dereference d, PathNode source, PathNode sink, Ssa::SourceVariable v, string msg, Element reason
2121
where d.isFirstMaybeNull(v.getAnSsaDefinition(), source, sink, msg, reason)
22-
select d, source, sink, "Variable $@ may be null here " + msg + ".", v, v.toString(), reason, "this"
22+
select d, source, sink, "Variable $@ may be null at this access " + msg + ".", v, v.toString(),
23+
reason, "this"

0 commit comments

Comments
 (0)