Compare commits

...

9 Commits

Author SHA1 Message Date
Tiferet Gazit
869846b306 Test a threshold of 0
Make sure we get near-perfect recall (ATM-light) and bad precision.
2022-01-04 16:41:21 -08:00
Tiferet Gazit
6d9a8fad34 Don't hard-code the score cutoff 2022-01-04 15:48:38 -08:00
Tiferet Gazit
e41b9e8776 Experiment with a threshold of 0.65 2022-01-04 15:46:17 -08:00
Tiferet Gazit
dc8711b28f Experiment with a fixed threshold of 0.65 2022-01-04 15:41:51 -08:00
Erik Krogh Kristensen
c7da8df03c Merge pull request #7511 from erik-krogh/dedup-spaces
Python: remove duplicated spaces in qldoc
2022-01-04 21:39:15 +01:00
Erik Krogh Kristensen
fe1107ccac remove duplicated spaces in qldoc 2022-01-04 21:03:06 +01:00
Mathias Vorreiter Pedersen
8f843209a8 Merge pull request #7493 from MrAnno/relax-ambiguously-signed-bit-field
C++: relax ambiguously-signed-bit-field by allowing GLib's gboolean
2022-01-04 16:18:46 +01:00
Mathias Vorreiter Pedersen
e31185fea4 C++: add change-note for cpp/ambiguously-signed-bit-field. 2022-01-04 14:31:19 +00:00
László Várady
6496bf8c1d C++: relax ambiguously-signed-bit-field by allowing GLib's gboolean
The gboolean type of GLib (a widely used C library) is a typedef to int.
It is meant to represent a simple true/false value.

Resolves #7491
2022-01-04 14:22:48 +00:00
9 changed files with 17 additions and 16 deletions

View File

@@ -26,6 +26,8 @@ where
// At least for C programs on Windows, BOOL is a common typedef for a type // At least for C programs on Windows, BOOL is a common typedef for a type
// representing BoolType. // representing BoolType.
not bf.getType().hasName("BOOL") and not bf.getType().hasName("BOOL") and
// GLib's gboolean is a typedef for a type representing BoolType.
not bf.getType().hasName("gboolean") and
// If this is true, then there cannot be unsigned sign extension or overflow. // If this is true, then there cannot be unsigned sign extension or overflow.
not bf.getDeclaredNumBits() = bf.getType().getSize() * 8 and not bf.getDeclaredNumBits() = bf.getType().getSize() * 8 and
not bf.isAnonymous() and not bf.isAnonymous() and

View File

@@ -0,0 +1,5 @@
---
category: minorAnalysis
---
* Added exception for GLib's gboolean to cpp/ambiguously-signed-bit-field.
This change reduces the number of false positives in the query.

View File

@@ -105,8 +105,8 @@ abstract class ATMConfig extends string {
* *
* Specifies the default cut-off value that controls how many alerts are produced. * Specifies the default cut-off value that controls how many alerts are produced.
* The cut-off value must be in the range [0,1]. * The cut-off value must be in the range [0,1].
* A cut-off value of 0 only produces alerts that are likely true-positives. * A cut-off value of >~0.5 only produces alerts that are likely true-positives.
* A cut-off value of 1 produces all alerts including those that are likely false-positives. * A cut-off value of 0 produces all alerts including those that are likely false-positives.
*/ */
float getScoreCutoff() { result = 0.0 } float getScoreCutoff() { result = 0. }
} }

View File

@@ -205,14 +205,8 @@ class EndpointScoringResults extends ScoringResults {
exists(float sinkScore | exists(float sinkScore |
ModelScoring::endpointScores(sink, getCfg().getASinkEndpointType().getEncoding(), ModelScoring::endpointScores(sink, getCfg().getASinkEndpointType().getEncoding(),
sinkScore) and sinkScore) and
// Include the endpoint if (a) the query endpoint type scores higher than all other // Include the endpoint if the query endpoint type scores higher than a fixed threshold
// endpoint types, or (b) the query endpoint type scores at least sinkScore >= getCfg().getScoreCutoff()
// 0.5 - (getCfg().getScoreCutoff() / 2).
sinkScore >=
[
max(float s | ModelScoring::endpointScores(sink, _, s)),
0.5 - getCfg().getScoreCutoff() / 2
]
) )
) )
} }