@@ -62,14 +62,11 @@ private float getScoreForSource(DataFlow::Node source) {
6262private float getScoreForSink ( DataFlow:: Node sink ) {
6363 if getCfg ( ) .isKnownSink ( sink )
6464 then result = 1.0
65- else
66- if getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , result , _)
67- then any ( )
68- else (
69- // This restriction on `sink` has no semantic effect but improves performance.
70- getCfg ( ) .isEffectiveSink ( sink ) and
71- ModelScoring:: endpointScores ( sink , getCfg ( ) .getASinkEndpointType ( ) .getEncoding ( ) , result )
72- )
65+ else (
66+ // This restriction on `sink` has no semantic effect but improves performance.
67+ getCfg ( ) .isEffectiveSink ( sink ) and
68+ ModelScoring:: endpointScores ( sink , getCfg ( ) .getASinkEndpointType ( ) .getEncoding ( ) , result )
69+ )
7370}
7471
7572class EndpointScoringResults extends ScoringResults {
@@ -109,10 +106,6 @@ class EndpointScoringResults extends ScoringResults {
109106 result = "known" and getCfg ( ) .isKnownSink ( sink )
110107 or
111108 not getCfg ( ) .isKnownSink ( sink ) and
112- getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , _, result )
113- or
114- not getCfg ( ) .isKnownSink ( sink ) and
115- not getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , _, _) and
116109 result =
117110 "predicted (scores: " +
118111 concat ( EndpointType type , float score |
@@ -127,29 +120,21 @@ class EndpointScoringResults extends ScoringResults {
127120 override predicate shouldResultBeIncluded ( DataFlow:: Node source , DataFlow:: Node sink ) {
128121 if getCfg ( ) .isKnownSink ( sink )
129122 then any ( )
130- else
131- if getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , _, _)
132- then
133- exists ( float score |
134- getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , score , _) and
135- score >= getCfg ( ) .getScoreCutoff ( )
136- )
137- else (
138- // This restriction on `sink` has no semantic effect but improves performance.
139- getCfg ( ) .isEffectiveSink ( sink ) and
140- exists ( float sinkScore |
141- ModelScoring:: endpointScores ( sink , getCfg ( ) .getASinkEndpointType ( ) .getEncoding ( ) ,
142- sinkScore ) and
143- // Include the endpoint if (a) the query endpoint type scores higher than all other
144- // endpoint types, or (b) the query endpoint type scores at least
145- // 0.5 - (getCfg().getScoreCutoff() / 2).
146- sinkScore >=
147- [
148- max ( float s | ModelScoring:: endpointScores ( sink , _, s ) ) ,
149- 0.5 - getCfg ( ) .getScoreCutoff ( ) / 2
150- ]
151- )
123+ else (
124+ // This restriction on `sink` has no semantic effect but improves performance.
125+ getCfg ( ) .isEffectiveSink ( sink ) and
126+ exists ( float sinkScore |
127+ ModelScoring:: endpointScores ( sink , getCfg ( ) .getASinkEndpointType ( ) .getEncoding ( ) , sinkScore ) and
128+ // Include the endpoint if (a) the query endpoint type scores higher than all other
129+ // endpoint types, or (b) the query endpoint type scores at least
130+ // 0.5 - (getCfg().getScoreCutoff() / 2).
131+ sinkScore >=
132+ [
133+ max ( float s | ModelScoring:: endpointScores ( sink , _, s ) ) ,
134+ 0.5 - getCfg ( ) .getScoreCutoff ( ) / 2
135+ ]
152136 )
137+ )
153138 }
154139}
155140
0 commit comments