From 9aba7a0bca9cad2aeb8a6d9df82219a3f249ba0c Mon Sep 17 00:00:00 2001 From: tiferet Date: Thu, 8 Dec 2022 12:45:58 -0800 Subject: [PATCH] Bug fixes for things that interfere with using the codex model --- .../adaptivethreatmodeling/EndpointScoring.qll | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointScoring.qll b/javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointScoring.qll index 2e25fb78ef3..935e53e6255 100644 --- a/javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointScoring.qll +++ b/javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/EndpointScoring.qll @@ -88,9 +88,7 @@ private float getScoreForSink(DataFlow::Node sink) { } class EndpointScoringResults extends ScoringResults { - EndpointScoringResults() { - this = "EndpointScoringResults" and exists(getACompatibleModelChecksum()) - } + EndpointScoringResults() { this = "EndpointScoringResults" } /** * Get ATM's confidence that a path between `source` and `sink` represents a security @@ -143,15 +141,7 @@ class EndpointScoringResults extends ScoringResults { // This restriction on `sink` has no semantic effect but improves performance. getCfg().isEffectiveSink(sink) and exists(float sinkScore | - ModelScoring::endpointScores(sink, getCfg().getASinkEndpointType().getEncoding(), sinkScore) and - // Include the endpoint if (a) the query endpoint type scores higher than all other - // endpoint types, or (b) the query endpoint type scores at least - // 0.5 - (getCfg().getScoreCutoff() / 2). - sinkScore >= - [ - max(float s | ModelScoring::endpointScores(sink, _, s)), - 0.5 - getCfg().getScoreCutoff() / 2 - ] + ModelScoring::endpointScores(sink, getCfg().getASinkEndpointType().getEncoding(), sinkScore) ) ) }