Skip to content

Commit c240c1b

Browse files
Stephan Brandaueraeisenberg
andauthored
Java: review suggestions from aeisenberg
Co-authored-by: Andrew Eisenberg <[email protected]>
1 parent e97456f commit c240c1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/ql/automodel/src/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This pack contains the automodel extraction queries for Java.
44

55
## Extraction Queries in `java/ql/automodel/src`
66

7-
This pack contains extraction queries for application mode and framework mode.
7+
Included in this pack are queries for both application mode and framework mode.
88

99
| Kind | Mode | Query File |
1010
|------|------|------------|
@@ -17,7 +17,7 @@ This pack contains extraction queries for application mode and framework mode.
1717

1818
## Running the Queries
1919

20-
The extraction queries are part of a separate query pack, `java-automodel-queries`. Use this pack to run them. The queries are tagged appropriately, you can use the tags (example here: https://github.com/github/codeql/blob/main/java/ql/automodel/src/AutomodelApplicationModeExtractNegativeExamples.ql#L8) to construct query suites.
20+
The extraction queries are part of a separate query pack, `codeql/java-automodel-queries`. Use this pack to run them. The queries are tagged appropriately, you can use the tags (example here: https://github.com/github/codeql/blob/main/java/ql/automodel/src/AutomodelApplicationModeExtractNegativeExamples.ql#L8) to construct query suites.
2121

2222
For example, a query suite selecting all example extraction queries (positive and negative) for application mode looks like this:
2323

@@ -41,7 +41,7 @@ For example, a query suite selecting all example extraction queries (positive an
4141

4242
### Concept: `Endpoint`
4343

44-
Endpoints are source code locations of interest. All +/- examples and all candidates are endpoints, but not all endpoints are examples or candidates. Each mode decides what endpoints are relevant. For instance, if the Java application mode wants to support candidates for sinks that are arguments passed to unknown method calls, then the Java application mode implementation needs to make sure that method arguments are endpoints. If you look at the `TApplicationModeEndpoint` implementation in [AutomodelApplicationModeCharacteristics.qll](https://github.com/github/codeql/blob/main/java/ql/automodel/src/AutomodelApplicationModeCharacteristics.qll), you can see that this is the case: the `TExplicitArgument` implements this behavior.
44+
Endpoints are source code locations of interest. All +/- examples and all candidates are endpoints, but not all endpoints are examples or candidates. Each mode decides which endpoints are relevant. For instance, if the Java application mode wants to support candidates for sinks that are arguments passed to unknown method calls, then the Java application mode implementation needs to make sure that method arguments are endpoints. If you look at the `TApplicationModeEndpoint` implementation in [AutomodelApplicationModeCharacteristics.qll](https://github.com/github/codeql/blob/main/java/ql/automodel/src/AutomodelApplicationModeCharacteristics.qll), you can see that this is the case: the `TExplicitArgument` implements this behavior.
4545

4646
Whether or not an endpoint is a +/- example, or a candidate depends on the individual extraction queries.
4747

@@ -57,7 +57,7 @@ The +/- and candidate extraction queries largely<sup>[1](#largely-use-characteri
5757

5858
#### :warning: Warning
5959

60-
Do not to "fix" shortcomings that could be fixed by a better prompt or better example selection by adding language- or mode-specific characteristics . Those "fixes" tend to be confusing downstream when questions like "why wasn't this location selected as a candidate?" becomes progressively harder and harder to answer. It's best to rely on characteristics in the code that is shared across all languages and modes (see [Shared Code](#shared-code)).
60+
Do not try to "fix" shortcomings that could be fixed by a better prompt or better example selection by adding language- or mode-specific characteristics . Those "fixes" tend to be confusing downstream when questions like "why wasn't this location selected as a candidate?" becomes progressively harder and harder to answer. It's best to rely on characteristics in the code that is shared across all languages and modes (see [Shared Code](#shared-code)).
6161

6262
## Shared Code
6363

@@ -117,7 +117,7 @@ Source candidates are a bit more varied than sink candidates:
117117

118118
##### Parameters as Source Candidates
119119

120-
A parameter could be a source, eg. when a framework passes user-controlled data to a handler defined in customer code.
120+
A parameter could be a source, e.g. when a framework passes user-controlled data to a handler defined in customer code.
121121
```java
122122
// customer code using a library:
123123
import java.net.http.WebSocket;

0 commit comments

Comments
 (0)