@@ -62,14 +62,11 @@ private float getScoreForSource(DataFlow::Node source) {
62
62
private float getScoreForSink ( DataFlow:: Node sink ) {
63
63
if getCfg ( ) .isKnownSink ( sink )
64
64
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
+ )
73
70
}
74
71
75
72
class EndpointScoringResults extends ScoringResults {
@@ -109,10 +106,6 @@ class EndpointScoringResults extends ScoringResults {
109
106
result = "known" and getCfg ( ) .isKnownSink ( sink )
110
107
or
111
108
not getCfg ( ) .isKnownSink ( sink ) and
112
- getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , _, result )
113
- or
114
- not getCfg ( ) .isKnownSink ( sink ) and
115
- not getCfg ( ) .isEffectiveSinkWithOverridingScore ( sink , _, _) and
116
109
result =
117
110
"predicted (scores: " +
118
111
concat ( EndpointType type , float score |
@@ -127,29 +120,21 @@ class EndpointScoringResults extends ScoringResults {
127
120
override predicate shouldResultBeIncluded ( DataFlow:: Node source , DataFlow:: Node sink ) {
128
121
if getCfg ( ) .isKnownSink ( sink )
129
122
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
+ ]
152
136
)
137
+ )
153
138
}
154
139
}
155
140
0 commit comments