@@ -55,6 +55,12 @@ signature module CandidateSig {
5555 */
5656 predicate isNeutral ( Endpoint e ) ;
5757
58+ /**
59+ * A related location is a source code location that may hold extra information about an endpoint that can be useful
60+ * to the machine learning model.
61+ *
62+ * For example, a related location for a method call may be the documentation comment of a method.
63+ */
5864 RelatedLocation getRelatedLocation ( Endpoint e , string name ) ;
5965}
6066
@@ -95,8 +101,8 @@ module SharedCharacteristics<CandidateSig Candidate> {
95101 }
96102
97103 /**
98- * If it exists, gets a related location for a given endpoint or candidate .
99- * If it doesn't exist, returns the candidate itself as a 'null' value .
104+ * Gets the related location of `e` with name `name`, if it exists .
105+ * Otherwise, gets the candidate itself.
100106 */
101107 bindingset [ name]
102108 Candidate:: RelatedLocation getRelatedLocationOrCandidate ( Candidate:: Endpoint e , string name ) {
@@ -115,8 +121,8 @@ module SharedCharacteristics<CandidateSig Candidate> {
115121 // An endpoint is a sink candidate if none of its characteristics give much indication whether or not it is a sink.
116122 not sinkType instanceof Candidate:: NegativeEndpointType and
117123 result .appliesToEndpoint ( candidateSink ) and
118- // Exclude endpoints that have a characteristic that implies they're not sinks for _any_ sink type.
119124 (
125+ // Exclude endpoints that have a characteristic that implies they're not sinks for _any_ sink type.
120126 exists ( float confidence |
121127 confidence >= mediumConfidence ( ) and
122128 result .hasImplications ( any ( Candidate:: NegativeEndpointType t ) , true , confidence )
@@ -144,8 +150,7 @@ module SharedCharacteristics<CandidateSig Candidate> {
144150 EndpointCharacteristic ( ) { any ( ) }
145151
146152 /**
147- * Holds for parameters that have this characteristic. This predicate contains the logic that applies characteristics
148- * to the appropriate set of dataflow parameters.
153+ * Holds for endpoints that have this characteristic.
149154 */
150155 abstract predicate appliesToEndpoint ( Candidate:: Endpoint n ) ;
151156
0 commit comments