Compare CodeQL and Jev on matched public methods
#31
by jfbrown95 - opened
- CODEQL.md +65 -0
- README.md +22 -0
- codeql-cohort.json +38 -0
- codeql-comparison/bug.jsonl +52 -0
- codeql-comparison/results.json +97 -0
- codeql-comparison/security.jsonl +70 -0
- codeql_compare.py +409 -0
- test_codeql_compare.py +57 -0
CODEQL.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CodeQL comparison
|
| 2 |
+
|
| 3 |
+
This track compares CodeQL with the saved Jev run on the same public method
|
| 4 |
+
pairs. CodeQL analyzes each repository snapshot. Jev's saved decision for each
|
| 5 |
+
method is read from `predictions/current/`.
|
| 6 |
+
|
| 7 |
+
The cohort is listed in [`codeql-cohort.json`](codeql-cohort.json). A pair is
|
| 8 |
+
counted only if both source states can be recreated, CodeQL extracts both
|
| 9 |
+
target files, and the method text matches the recorded lines. Failed or
|
| 10 |
+
unavailable snapshots are excluded from both models' counts. This is a subset
|
| 11 |
+
of the public bug and security benchmarks, so its results are separate from
|
| 12 |
+
the full-set model tables.
|
| 13 |
+
|
| 14 |
+
Input revisions for this run: `bug-pairs-public@80cc6cbcf4b44e140706bcef3d40336ae81e7a05`,
|
| 15 |
+
`security-pairs-public@0b3312a609892f4383e8252841ea94fdf74b2935`, and
|
| 16 |
+
the SWE-rebench V2 Parquet file with SHA-256
|
| 17 |
+
`0e0bf9355f892ad74ae98d4e1c404f39fd6654a8e351ee3e6ab162e4a64cd3ad`.
|
| 18 |
+
|
| 19 |
+
CodeQL CLI 2.27.1 runs the published `security-extended` suite for security
|
| 20 |
+
and `security-and-quality` for bugs. The query packs are pinned to
|
| 21 |
+
`codeql/python-queries@1.8.11`, `codeql/javascript-queries@2.4.6`, and
|
| 22 |
+
`codeql/cpp-queries@1.9.0`. For the bug track, only results tagged
|
| 23 |
+
`correctness`, `reliability`, or `security` count; pure maintainability advice
|
| 24 |
+
does not represent a bug. A finding counts for a method only when its primary
|
| 25 |
+
SARIF location overlaps that method's recorded source lines. A finding
|
| 26 |
+
elsewhere in the file is not assigned to the method.
|
| 27 |
+
|
| 28 |
+
Python, JavaScript, TypeScript, C, and C++ snapshots use CodeQL's no-build
|
| 29 |
+
extraction. For [SWE-rebench V2](https://huggingface.co/datasets/nebius/SWE-rebench-V2)
|
| 30 |
+
bug pairs, the runner applies the dataset's gold patch to its pinned
|
| 31 |
+
`base_commit` to reconstruct the repaired repository. It does not run project
|
| 32 |
+
code or tests.
|
| 33 |
+
|
| 34 |
+
To reproduce, download the public `benchmark.jsonl` files from
|
| 35 |
+
[`bug-pairs-public`](https://huggingface.co/datasets/perchscan/bug-pairs-public)
|
| 36 |
+
and [`security-pairs-public`](https://huggingface.co/datasets/perchscan/security-pairs-public)
|
| 37 |
+
into `public/bug/` and `public/security/`. Download SWE-rebench V2's `train`
|
| 38 |
+
Parquet file separately. Install Docker, the CodeQL CLI for your Docker
|
| 39 |
+
architecture, its three query packs at the versions above, and DuckDB. Then
|
| 40 |
+
run:
|
| 41 |
+
|
| 42 |
+
```sh
|
| 43 |
+
python3 codeql_compare.py scan \
|
| 44 |
+
--root /path/to/codeql-work \
|
| 45 |
+
--data /path/to/public \
|
| 46 |
+
--predictions predictions/current \
|
| 47 |
+
--codeql /path/to/codeql \
|
| 48 |
+
--rebench-parquet /path/to/swe-rebench-train.parquet
|
| 49 |
+
|
| 50 |
+
python3 codeql_compare.py score \
|
| 51 |
+
--root /path/to/codeql-work \
|
| 52 |
+
--data /path/to/public \
|
| 53 |
+
--predictions predictions/current
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
The runner writes per-pair decisions and aggregate counts under the work
|
| 57 |
+
directory. It resumes completed databases and SARIF analyses. CodeQL reports
|
| 58 |
+
binary findings here, so it has no average-precision score or threshold curve
|
| 59 |
+
to compare with Jev's probabilities. The semantic lint track is not included:
|
| 60 |
+
stock CodeQL queries do not take the pair's written behavior rule as input.
|
| 61 |
+
|
| 62 |
+
[GitHub's CodeQL documentation](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/codeql-query-suites)
|
| 63 |
+
describes the built-in suites and their intended coverage. The
|
| 64 |
+
[CLI terms](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/codeql-cli)
|
| 65 |
+
cover its use on public repositories.
|
README.md
CHANGED
|
@@ -132,6 +132,28 @@ Inference costs cover scoring the method sides in each table. Jev costs are esti
|
|
| 132 |
|
| 133 |
JevLike (192-byte input), Laya (512-token input), and Kev (packed-branch limit) could not score every full-context method. NanoJev was unavailable on Beam. They are excluded rather than ranked on partial results.
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
## Files and reproduction
|
| 136 |
|
| 137 |
- [`results-current.jsonl`](https://huggingface.co/datasets/perchscan/benchmark-results/blob/main/results-current.jsonl): current-pack aggregate results for public and private splits; no private pair data.
|
|
|
|
| 132 |
|
| 133 |
JevLike (192-byte input), Laya (512-token input), and Kev (packed-branch limit) could not score every full-context method. NanoJev was unavailable on Beam. They are excluded rather than ranked on partial results.
|
| 134 |
|
| 135 |
+
## CodeQL comparison
|
| 136 |
+
|
| 137 |
+
[CodeQL](https://codeql.github.com/) and Jev were evaluated on the same public method sides in a separate cohort. CodeQL analyzed full repository snapshots; Jev used its saved Perch inputs and recorded alert settings. A CodeQL finding counts when its primary location falls inside the labelled method. The matched set contains 52 bug pairs and 70 security pairs.
|
| 138 |
+
|
| 139 |
+
### Bugs: 52 pairs
|
| 140 |
+
|
| 141 |
+
| Tool | TP | FP | FN | Precision | Recall | F1 | False-positive rate |
|
| 142 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 143 |
+
| CodeQL | 0 | 0 | 21 | — (0 alerts) | 0.0% | 0.0% | 0.0% |
|
| 144 |
+
| Jev | 6 | 8 | 15 | 42.9% | 28.6% | 34.3% | 9.6% |
|
| 145 |
+
|
| 146 |
+
### Security: 70 pairs
|
| 147 |
+
|
| 148 |
+
| Tool | TP | FP | FN | Precision | Recall | F1 | False-positive rate |
|
| 149 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 150 |
+
| CodeQL | 1 | 0 | 26 | 100.0% (1 alert) | 3.7% | 7.1% | 0.0% |
|
| 151 |
+
| Jev | 8 | 12 | 19 | 40.0% | 29.6% | 34.0% | 10.6% |
|
| 152 |
+
|
| 153 |
+
TP is a finding on a labelled issue, FP is a finding on a labelled clean method, and FN is a missed issue. False-positive rate is FP divided by clean methods: 83 for bugs and 113 for security. CodeQL found an [OpenJPEG integer-overflow cast](https://github.com/uclouvain/openjpeg/commit/ef01f18dfc6780b776d0674ed3e7415c6ef54d24) in `opj_pi_create_decode` before the repair; Jev did not alert on that pair.
|
| 154 |
+
|
| 155 |
+
The [CodeQL protocol](CODEQL.md), [runner](codeql_compare.py), [matched method decisions](codeql-comparison/), and [cohort list](codeql-cohort.json) are published here. Four selected bug pairs and three security pairs were excluded because a source snapshot could not be analyzed. CodeQL returns findings rather than probabilities, so these rows have no average-precision score or threshold curve.
|
| 156 |
+
|
| 157 |
## Files and reproduction
|
| 158 |
|
| 159 |
- [`results-current.jsonl`](https://huggingface.co/datasets/perchscan/benchmark-results/blob/main/results-current.jsonl): current-pack aggregate results for public and private splits; no private pair data.
|
codeql-cohort.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"description": "Public CodeQL comparison cohort with pinned Python, JavaScript, TypeScript, C, and C++ method pairs.",
|
| 3 |
+
"bug": [
|
| 4 |
+
"Kludex/starlette",
|
| 5 |
+
"pallets/flask",
|
| 6 |
+
"pytest-dev/pluggy",
|
| 7 |
+
"tox-dev/tox",
|
| 8 |
+
"mcollina/autocannon",
|
| 9 |
+
"mswjs/msw",
|
| 10 |
+
"canjs/can-zone",
|
| 11 |
+
"codemanki/cloudscraper",
|
| 12 |
+
"gtalarico/pyairtable",
|
| 13 |
+
"illinois/queue",
|
| 14 |
+
"jamesramsay/hercule",
|
| 15 |
+
"rstudio/vetiver-python",
|
| 16 |
+
"nodejs/llhttp",
|
| 17 |
+
"transmission/transmission",
|
| 18 |
+
"nginx/nginx",
|
| 19 |
+
"qpdf/qpdf"
|
| 20 |
+
],
|
| 21 |
+
"security": [
|
| 22 |
+
"akshudev/pheonixappapi",
|
| 23 |
+
"authlib/joserfc",
|
| 24 |
+
"aio-libs/aiohttp-session",
|
| 25 |
+
"authlib/authlib",
|
| 26 |
+
"cole/aiosmtplib",
|
| 27 |
+
"jasmine/jasmine",
|
| 28 |
+
"agronholm/anyio",
|
| 29 |
+
"apragacz/django-rest-registration",
|
| 30 |
+
"executablebooks/markdown-it-py",
|
| 31 |
+
"axios/axios",
|
| 32 |
+
"nlnetlabs/unbound",
|
| 33 |
+
"catchorg/Catch2",
|
| 34 |
+
"nginx/nginx",
|
| 35 |
+
"rdesktop/rdesktop",
|
| 36 |
+
"uclouvain/openjpeg"
|
| 37 |
+
]
|
| 38 |
+
}
|
codeql-comparison/bug.jsonl
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.15, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-bug:16543a356f058fbf47da2140", "repository": "illinois/queue"}
|
| 2 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.49, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-bug:2b17cee97206f6f87767489d", "repository": "gtalarico/pyairtable"}
|
| 3 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.21, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.22, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-bug:9f9b5320a1291eb425836819", "repository": "rstudio/vetiver-python"}
|
| 4 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.11, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-bug:bcad204ebb52f5138d3ea837", "repository": "illinois/queue"}
|
| 5 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.35, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-bug:cd3617eee6b31e2e36c369e6", "repository": "canjs/can-zone"}
|
| 6 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.25, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.26, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-bug:dc53b49f8bf0f2baa2deb1c2", "repository": "rstudio/vetiver-python"}
|
| 7 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.16, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.17, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:0494646d1c4bb487c1d41c15", "repository": "pallets/flask"}
|
| 8 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.51, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.55, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:0982969f8885f6c0bc652747", "repository": "Kludex/starlette"}
|
| 9 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.23, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.25, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:1d73e59da6afa698740048b2", "repository": "pallets/flask"}
|
| 10 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:27ffc0a2776b318a006f8a0a", "repository": "pytest-dev/pluggy"}
|
| 11 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.21, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.2, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:2fb877739a64dafa2f0e6dfe", "repository": "tox-dev/tox"}
|
| 12 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.23, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.22, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:34d6f55233db4cc5c9b8b617", "repository": "tox-dev/tox"}
|
| 13 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.27, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.27, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:439cc87c0c861e6970eb806e", "repository": "pytest-dev/pluggy"}
|
| 14 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 0, "role": "after"}], "language": "c", "pair_id": "benign-multilang:543f0598f6d59ba19b6e7047", "repository": "nginx/nginx"}
|
| 15 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.35, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.33, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:5f82850995d49c7beb717913", "repository": "tox-dev/tox"}
|
| 16 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.32, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.33, "label": 0, "role": "after"}], "language": "c", "pair_id": "benign-multilang:68c6079b04da087f6a515aed", "repository": "nginx/nginx"}
|
| 17 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.18, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:6d32d7eb744684348a67b665", "repository": "pytest-dev/pluggy"}
|
| 18 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:7f191b012f6552ec4e3de345", "repository": "pallets/flask"}
|
| 19 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.21, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.2, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:7f4862e69a0e367e72a649ee", "repository": "Kludex/starlette"}
|
| 20 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:87a694061fe6dc3509fd2510", "repository": "pytest-dev/pluggy"}
|
| 21 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.21, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.24, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:88cb7066d52682f3a04d6226", "repository": "pallets/flask"}
|
| 22 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.17, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.17, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:88e37d34d2ef27dc6516f26a", "repository": "pytest-dev/pluggy"}
|
| 23 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.22, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.23, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:8bd3f31f443ae77d438d5357", "repository": "tox-dev/tox"}
|
| 24 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.2, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:8ed2368192761fa8563b5d48", "repository": "tox-dev/tox"}
|
| 25 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.43, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.42, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:95b39ce7cab786378bb0c5ca", "repository": "Kludex/starlette"}
|
| 26 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.22, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.22, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:a80f355e10a01e4ea4cd8582", "repository": "pallets/flask"}
|
| 27 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.43, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.45, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:c7f1dd08f8b77a113657db85", "repository": "Kludex/starlette"}
|
| 28 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.29, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.3, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-multilang:ffaa63f5ce8b55206631aa8f", "repository": "Kludex/starlette"}
|
| 29 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.05, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.05, "label": 0, "role": "after"}], "language": "cpp", "pair_id": "heldout-benign:calibration:96ddf0294b047542802791b5", "repository": "qpdf/qpdf"}
|
| 30 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.2, "label": 0, "role": "after"}], "language": "c", "pair_id": "heldout-benign:validation:1d27793bcd82f2fb67bfa100", "repository": "nodejs/llhttp"}
|
| 31 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.16, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.17, "label": 0, "role": "after"}], "language": "c", "pair_id": "heldout-benign:validation:8a2a5828d8161892adfe148c", "repository": "nodejs/llhttp"}
|
| 32 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.35, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.35, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:canjs__can-zone-103:100fc77182c7", "repository": "canjs/can-zone"}
|
| 33 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.38, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.48, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:canjs__can-zone-119:2c6fd03ec8a3", "repository": "canjs/can-zone"}
|
| 34 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.53, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.53, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:codemanki__cloudscraper-127:29fbfea99352", "repository": "codemanki/cloudscraper"}
|
| 35 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.4, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:codemanki__cloudscraper-127:9d8a3e6fa2d6", "repository": "codemanki/cloudscraper"}
|
| 36 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.56, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.53, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:codemanki__cloudscraper-137:234a450877ad", "repository": "codemanki/cloudscraper"}
|
| 37 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.49, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.47, "label": 0, "role": "after"}], "language": "python", "pair_id": "swe-rebench:gtalarico__pyairtable-250:02e24170afd9", "repository": "gtalarico/pyairtable"}
|
| 38 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.38, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.39, "label": 0, "role": "after"}], "language": "python", "pair_id": "swe-rebench:gtalarico__pyairtable-250:7f8fddbaab28", "repository": "gtalarico/pyairtable"}
|
| 39 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.33, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.31, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:illinois__queue-214:c5e119e89b30", "repository": "illinois/queue"}
|
| 40 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.74, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.74, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:jamesramsay__hercule-220:085707b5e55c", "repository": "jamesramsay/hercule"}
|
| 41 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.72, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.67, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:jamesramsay__hercule-220:65fb9e5f38cf", "repository": "jamesramsay/hercule"}
|
| 42 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.61, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.64, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:jamesramsay__hercule-220:fcebf8deb381", "repository": "jamesramsay/hercule"}
|
| 43 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.61, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.59, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:mcollina__autocannon-267:ef8fc9a6aac1", "repository": "mcollina/autocannon"}
|
| 44 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.28, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.37, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:mcollina__autocannon-332:0e34114137ab", "repository": "mcollina/autocannon"}
|
| 45 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.25, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.37, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "swe-rebench:mcollina__autocannon-332:4fd12d70dd0f", "repository": "mcollina/autocannon"}
|
| 46 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.18, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "after"}], "language": "typescript", "pair_id": "swe-rebench:mswjs__msw-2509:0a28baf66879", "repository": "mswjs/msw"}
|
| 47 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 0, "role": "after"}], "language": "typescript", "pair_id": "swe-rebench:mswjs__msw-2509:611d9f264dc3", "repository": "mswjs/msw"}
|
| 48 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.17, "label": 0, "role": "after"}], "language": "typescript", "pair_id": "swe-rebench:mswjs__msw-2509:9734aa3b2d18", "repository": "mswjs/msw"}
|
| 49 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.24, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.21, "label": 0, "role": "after"}], "language": "typescript", "pair_id": "swe-rebench:mswjs__msw-2509:c91aba5e55d5", "repository": "mswjs/msw"}
|
| 50 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.23, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.29, "label": 0, "role": "after"}], "language": "c", "pair_id": "swe-rebench:nodejs__llhttp-245:013562950290", "repository": "nodejs/llhttp"}
|
| 51 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.13, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.22, "label": 0, "role": "after"}], "language": "cpp", "pair_id": "swe-rebench:qpdf__qpdf-289:1286d5497696", "repository": "qpdf/qpdf"}
|
| 52 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.45, "label": 0, "role": "after"}], "language": "python", "pair_id": "swe-rebench:rstudio__vetiver-python-201:97ccdd87e120", "repository": "rstudio/vetiver-python"}
|
codeql-comparison/results.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bug": {
|
| 3 |
+
"missing_sides": [
|
| 4 |
+
{
|
| 5 |
+
"pair_id": "benign-bug:654f92c07b7e09c9a4bc00b9",
|
| 6 |
+
"reason": "CodeQL analysis unavailable",
|
| 7 |
+
"role": "before"
|
| 8 |
+
},
|
| 9 |
+
{
|
| 10 |
+
"pair_id": "swe-rebench:mcollina__autocannon-332:549c7e4f7eaa",
|
| 11 |
+
"reason": "source snapshot unavailable",
|
| 12 |
+
"role": "after"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"pair_id": "swe-rebench:transmission__transmission-5889:e7ed2acdc784",
|
| 16 |
+
"reason": "CodeQL analysis unavailable",
|
| 17 |
+
"role": "before"
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"pair_id": "swe-rebench:transmission__transmission-6177:10de829bf14c",
|
| 21 |
+
"reason": "CodeQL analysis unavailable",
|
| 22 |
+
"role": "before"
|
| 23 |
+
}
|
| 24 |
+
],
|
| 25 |
+
"models": {
|
| 26 |
+
"codeql": {
|
| 27 |
+
"f1": 0.0,
|
| 28 |
+
"fn": 21,
|
| 29 |
+
"fp": 0,
|
| 30 |
+
"fpr": 0.0,
|
| 31 |
+
"precision": null,
|
| 32 |
+
"recall": 0.0,
|
| 33 |
+
"recall_minus_fpr": 0.0,
|
| 34 |
+
"tn": 83,
|
| 35 |
+
"tp": 0
|
| 36 |
+
},
|
| 37 |
+
"jev": {
|
| 38 |
+
"f1": 0.34285714285714286,
|
| 39 |
+
"fn": 15,
|
| 40 |
+
"fp": 8,
|
| 41 |
+
"fpr": 0.0963855421686747,
|
| 42 |
+
"precision": 0.42857142857142855,
|
| 43 |
+
"recall": 0.2857142857142857,
|
| 44 |
+
"recall_minus_fpr": 0.189328743545611,
|
| 45 |
+
"tn": 75,
|
| 46 |
+
"tp": 6
|
| 47 |
+
}
|
| 48 |
+
},
|
| 49 |
+
"pairs": 52,
|
| 50 |
+
"requested_pairs": 56
|
| 51 |
+
},
|
| 52 |
+
"security": {
|
| 53 |
+
"missing_sides": [
|
| 54 |
+
{
|
| 55 |
+
"pair_id": "benign-multilang:92f8c1dd3d04cf1d36a9399f",
|
| 56 |
+
"reason": "CodeQL analysis unavailable",
|
| 57 |
+
"role": "after"
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"pair_id": "benign-multilang:c6e0c1d6f8cead4e776f37c9",
|
| 61 |
+
"reason": "CodeQL analysis unavailable",
|
| 62 |
+
"role": "after"
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"pair_id": "benign-multilang:fcdedd456a15c760f122a8a3",
|
| 66 |
+
"reason": "CodeQL analysis unavailable",
|
| 67 |
+
"role": "after"
|
| 68 |
+
}
|
| 69 |
+
],
|
| 70 |
+
"models": {
|
| 71 |
+
"codeql": {
|
| 72 |
+
"f1": 0.07142857142857142,
|
| 73 |
+
"fn": 26,
|
| 74 |
+
"fp": 0,
|
| 75 |
+
"fpr": 0.0,
|
| 76 |
+
"precision": 1.0,
|
| 77 |
+
"recall": 0.037037037037037035,
|
| 78 |
+
"recall_minus_fpr": 0.037037037037037035,
|
| 79 |
+
"tn": 113,
|
| 80 |
+
"tp": 1
|
| 81 |
+
},
|
| 82 |
+
"jev": {
|
| 83 |
+
"f1": 0.3404255319148936,
|
| 84 |
+
"fn": 19,
|
| 85 |
+
"fp": 12,
|
| 86 |
+
"fpr": 0.10619469026548672,
|
| 87 |
+
"precision": 0.4,
|
| 88 |
+
"recall": 0.2962962962962963,
|
| 89 |
+
"recall_minus_fpr": 0.19010160603080956,
|
| 90 |
+
"tn": 101,
|
| 91 |
+
"tp": 8
|
| 92 |
+
}
|
| 93 |
+
},
|
| 94 |
+
"pairs": 70,
|
| 95 |
+
"requested_pairs": 73
|
| 96 |
+
}
|
| 97 |
+
}
|
codeql-comparison/security.jsonl
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"decisions": [{"codeql_alert": true, "codeql_rules": ["cpp/integer-multiplication-cast-to-long"], "jev_alert": false, "jev_score": 0.67, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.67, "label": 0, "role": "after"}], "language": "c", "pair_id": "1ec1e10d8ecc3aeec647c7f5", "repository": "uclouvain/openjpeg"}
|
| 2 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.9, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.94, "label": 0, "role": "after"}], "language": "c", "pair_id": "247ca4e518f9cfccd1235591", "repository": "nlnetlabs/unbound"}
|
| 3 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.75, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.75, "label": 0, "role": "after"}], "language": "c", "pair_id": "2738b17989a2f974474f276b", "repository": "uclouvain/openjpeg"}
|
| 4 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.76, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.77, "label": 0, "role": "after"}], "language": "c", "pair_id": "357c8e2348fbf98e5acbced4", "repository": "rdesktop/rdesktop"}
|
| 5 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.74, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.75, "label": 0, "role": "after"}], "language": "c", "pair_id": "47b7780c89aa5812110eed03", "repository": "uclouvain/openjpeg"}
|
| 6 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.74, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.75, "label": 0, "role": "after"}], "language": "c", "pair_id": "698e1aa9f5800ee5c7575233", "repository": "uclouvain/openjpeg"}
|
| 7 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.74, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.72, "label": 0, "role": "after"}], "language": "c", "pair_id": "a11da60389905c67b9a81b8d", "repository": "uclouvain/openjpeg"}
|
| 8 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.7, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.73, "label": 0, "role": "after"}], "language": "c", "pair_id": "benign-multilang:0de2751599cf46ca2047fba5", "repository": "nginx/nginx"}
|
| 9 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.15, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.16, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-multilang:309f41718d6ffba903bbd7ba", "repository": "jasmine/jasmine"}
|
| 10 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.11, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.12, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-multilang:369b29e7f6a8e1e696909108", "repository": "jasmine/jasmine"}
|
| 11 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.19, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.17, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-multilang:65508d79a39df59871da37f9", "repository": "jasmine/jasmine"}
|
| 12 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.69, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.7, "label": 0, "role": "after"}], "language": "c", "pair_id": "benign-multilang:87cd5e290433a879b5aa7d56", "repository": "nginx/nginx"}
|
| 13 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.48, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.48, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-multilang:9c09d122c4f97810401ec64a", "repository": "axios/axios"}
|
| 14 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.73, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.69, "label": 0, "role": "after"}], "language": "javascript", "pair_id": "benign-multilang:d8ccae467ff3c1bd79f50cd3", "repository": "axios/axios"}
|
| 15 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.39, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-security:06e47656484b0970265fb32a", "repository": "executablebooks/markdown-it-py"}
|
| 16 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.37, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-security:14ce8ac6a09dc33e62af5c0e", "repository": "aio-libs/aiohttp-session"}
|
| 17 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.18, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.18, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-security:37cc8f7b09a927a94981a054", "repository": "authlib/joserfc"}
|
| 18 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.3, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.28, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-security:39142125534d024277d80000", "repository": "aio-libs/aiohttp-session"}
|
| 19 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.49, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.48, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-security:87217e7c9bd73eeb33cbd25a", "repository": "agronholm/anyio"}
|
| 20 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.32, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.3, "label": 0, "role": "after"}], "language": "python", "pair_id": "benign-security:e5ef550f528b16a9f0b6a30f", "repository": "apragacz/django-rest-registration"}
|
| 21 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.68, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.69, "label": 0, "role": "after"}], "language": "c", "pair_id": "cdd762600e55fe2c3e0f5284", "repository": "rdesktop/rdesktop"}
|
| 22 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.66, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.67, "label": 0, "role": "after"}], "language": "c", "pair_id": "e53808b6fb6ba5f610474c8a", "repository": "uclouvain/openjpeg"}
|
| 23 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.69, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.69, "label": 0, "role": "after"}], "language": "c", "pair_id": "f72694bd37925e411875669a", "repository": "uclouvain/openjpeg"}
|
| 24 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.84, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.82, "label": 0, "role": "after"}], "language": "c", "pair_id": "fd45265c79745554ce66fbf1", "repository": "nlnetlabs/unbound"}
|
| 25 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.42, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.37, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:agronholm/anyio:68f58915f82d9be8109ebbbd8f5d70577d43f2ce:f290c0cdb2b2", "repository": "agronholm/anyio"}
|
| 26 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.51, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:aio-libs/aiohttp-session:1b356f01bbab57d041c9a75bacd72fbbf8524728:74e6e1a8c51f", "repository": "aio-libs/aiohttp-session"}
|
| 27 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.64, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.62, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:055a0d458fe1", "repository": "akshudev/pheonixappapi"}
|
| 28 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.64, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.66, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:09d18ade59a6", "repository": "akshudev/pheonixappapi"}
|
| 29 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.52, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:0d8ed684d4dd", "repository": "akshudev/pheonixappapi"}
|
| 30 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.54, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.46, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:1396217c8af5", "repository": "akshudev/pheonixappapi"}
|
| 31 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.58, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.6, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:1c7c39b59495", "repository": "akshudev/pheonixappapi"}
|
| 32 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.56, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.52, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:2d24444c6784", "repository": "akshudev/pheonixappapi"}
|
| 33 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.57, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.59, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:2ffd627cd903", "repository": "akshudev/pheonixappapi"}
|
| 34 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.52, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.54, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:39b366cfa8c5", "repository": "akshudev/pheonixappapi"}
|
| 35 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.45, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.45, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:42cf86d28da6", "repository": "akshudev/pheonixappapi"}
|
| 36 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.61, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.53, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:5fd9c3245e18", "repository": "akshudev/pheonixappapi"}
|
| 37 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.54, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:5ff4cecfb824", "repository": "akshudev/pheonixappapi"}
|
| 38 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.47, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.44, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:76cb9c02c4e7", "repository": "akshudev/pheonixappapi"}
|
| 39 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.53, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:831a6048c2af", "repository": "akshudev/pheonixappapi"}
|
| 40 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.59, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.52, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:878303403610", "repository": "akshudev/pheonixappapi"}
|
| 41 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.43, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.44, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:896052e3f6be", "repository": "akshudev/pheonixappapi"}
|
| 42 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.51, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.49, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:95dda39b9dbf", "repository": "akshudev/pheonixappapi"}
|
| 43 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.62, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.58, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:9660db178725", "repository": "akshudev/pheonixappapi"}
|
| 44 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.45, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:9df33b5f284e", "repository": "akshudev/pheonixappapi"}
|
| 45 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.55, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.56, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:a347d85efa83", "repository": "akshudev/pheonixappapi"}
|
| 46 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.6, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.59, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:a5df615c9b12", "repository": "akshudev/pheonixappapi"}
|
| 47 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.47, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.47, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:adfbfc5f755f", "repository": "akshudev/pheonixappapi"}
|
| 48 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.46, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:b5e63fd65164", "repository": "akshudev/pheonixappapi"}
|
| 49 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.44, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.43, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:be0ca64a9f71", "repository": "akshudev/pheonixappapi"}
|
| 50 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.5, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.52, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:c9a5bb254488", "repository": "akshudev/pheonixappapi"}
|
| 51 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.62, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.58, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:d53eca708124", "repository": "akshudev/pheonixappapi"}
|
| 52 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.51, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.55, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:dbfcb2475459", "repository": "akshudev/pheonixappapi"}
|
| 53 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.51, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.49, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:akshudev/pheonixappapi:0937419e323f5ea9013d43dc1b82fef9d7e05044:f6aea4de609e", "repository": "akshudev/pheonixappapi"}
|
| 54 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.37, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.37, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:apragacz/django-rest-registration:26d094fab65ea8c2694fdfb6a3ab95a7808b62d5:27e3aba12209", "repository": "apragacz/django-rest-registration"}
|
| 55 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.58, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.55, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/authlib:2808378611dd6fb2532b189a9087877d8f0c0489:03b7ed0be2d4", "repository": "authlib/authlib"}
|
| 56 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.36, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.45, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/authlib:2808378611dd6fb2532b189a9087877d8f0c0489:46632269336d", "repository": "authlib/authlib"}
|
| 57 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.32, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.31, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/authlib:2808378611dd6fb2532b189a9087877d8f0c0489:82226a00b11c", "repository": "authlib/authlib"}
|
| 58 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.11, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:1e1bfec393da", "repository": "authlib/joserfc"}
|
| 59 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.08, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.09, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:377c2fd05cf4", "repository": "authlib/joserfc"}
|
| 60 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.13, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.08, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:55c89b57471e", "repository": "authlib/joserfc"}
|
| 61 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.12, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:6724c80eb3cc", "repository": "authlib/joserfc"}
|
| 62 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.09, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:68555687586b", "repository": "authlib/joserfc"}
|
| 63 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.09, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.08, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:6ba9e7498b7e", "repository": "authlib/joserfc"}
|
| 64 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.12, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:cd19f9b43b92", "repository": "authlib/joserfc"}
|
| 65 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.1, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.09, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:authlib/joserfc:63932f169d924caffafa761af2122b82059017f7:fc5f55ff25ff", "repository": "authlib/joserfc"}
|
| 66 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.14, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.13, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:cole/aiosmtplib:9fab7ba1361dbf7622ede1315a24be805cff09c9:bc493834cf12", "repository": "cole/aiosmtplib"}
|
| 67 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.8, "label": 1, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.8, "label": 0, "role": "after"}], "language": "python", "pair_id": "github-advisory:executablebooks/markdown-it-py:53ca3e9c2b9e9b295f6abf7f4ad2730a9b70f68c:4d2bdf2323b5", "repository": "executablebooks/markdown-it-py"}
|
| 68 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.08, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.08, "label": 0, "role": "after"}], "language": "python", "pair_id": "heldout-benign:calibration:43d8471d0d0a0d650cce0a67", "repository": "cole/aiosmtplib"}
|
| 69 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.51, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": false, "jev_score": 0.48, "label": 0, "role": "after"}], "language": "python", "pair_id": "heldout-benign:calibration:d87930c84e8761971804001f", "repository": "cole/aiosmtplib"}
|
| 70 |
+
{"decisions": [{"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.75, "label": 0, "role": "before"}, {"codeql_alert": false, "codeql_rules": [], "jev_alert": true, "jev_score": 0.76, "label": 0, "role": "after"}], "language": "c", "pair_id": "heldout-benign:validation:5d634a64b1bacdaf30615c64", "repository": "nlnetlabs/unbound"}
|
codeql_compare.py
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Run CodeQL on the pinned public cohort and compare method-level alerts.
|
| 3 |
+
|
| 4 |
+
The caller supplies the downloaded public benchmark.jsonl files. GitHub's
|
| 5 |
+
CodeQL CLI and query packs are installed separately; this script does not
|
| 6 |
+
download or redistribute them.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import argparse
|
| 10 |
+
import concurrent.futures
|
| 11 |
+
import json
|
| 12 |
+
import re
|
| 13 |
+
import shutil
|
| 14 |
+
import subprocess
|
| 15 |
+
import time
|
| 16 |
+
from collections import defaultdict
|
| 17 |
+
from functools import lru_cache
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
from zipfile import ZipFile
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
LANGUAGES = {"python": "python", "javascript": "javascript", "typescript": "javascript",
|
| 23 |
+
"c": "cpp", "c++": "cpp", "cpp": "cpp"}
|
| 24 |
+
PACKS = {"python": "1.8.11", "javascript": "2.4.6", "cpp": "1.9.0"}
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def rows(path):
|
| 28 |
+
with open(path, encoding="utf-8") as stream:
|
| 29 |
+
for line in stream:
|
| 30 |
+
if line.strip():
|
| 31 |
+
yield json.loads(line)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def selected_pairs(args):
|
| 35 |
+
cohort = json.loads(Path(args.cohort).read_text())
|
| 36 |
+
selected = {}
|
| 37 |
+
for domain in ("bug", "security"):
|
| 38 |
+
repos = set(cohort[domain])
|
| 39 |
+
selected[domain] = [
|
| 40 |
+
pair for pair in rows(Path(args.data) / domain / "benchmark.jsonl")
|
| 41 |
+
if pair["repository"] in repos
|
| 42 |
+
and pair["language"].lower() in LANGUAGES
|
| 43 |
+
and all(pair[role].get("revision") for role in ("before", "after"))
|
| 44 |
+
]
|
| 45 |
+
return selected
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def run(command, log_path, timeout=None, container_name=None):
|
| 49 |
+
log_path.parent.mkdir(parents=True, exist_ok=True)
|
| 50 |
+
start = time.monotonic()
|
| 51 |
+
with log_path.open("w", encoding="utf-8") as log:
|
| 52 |
+
try:
|
| 53 |
+
result = subprocess.run(command, stdout=log, stderr=subprocess.STDOUT,
|
| 54 |
+
timeout=timeout)
|
| 55 |
+
code = result.returncode
|
| 56 |
+
except subprocess.TimeoutExpired:
|
| 57 |
+
if container_name:
|
| 58 |
+
subprocess.run(["docker", "stop", "--time", "2", container_name],
|
| 59 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
| 60 |
+
log.write(f"CodeQL stage exceeded {timeout} seconds.\n")
|
| 61 |
+
code = 124
|
| 62 |
+
return code, round(time.monotonic() - start, 2)
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def prepare_rebench_patches(pairs, root, source_parquet):
|
| 66 |
+
"""Recreate SWE-rebench repaired snapshots from its published gold patches."""
|
| 67 |
+
if not source_parquet:
|
| 68 |
+
return
|
| 69 |
+
instances = {}
|
| 70 |
+
for pair in pairs["bug"]:
|
| 71 |
+
if not pair["pair_id"].startswith("swe-rebench:"):
|
| 72 |
+
continue
|
| 73 |
+
if "+" in pair["after"]["revision"]:
|
| 74 |
+
continue
|
| 75 |
+
instance = pair["pair_id"].split(":", 2)[1]
|
| 76 |
+
if not re.fullmatch(r"[A-Za-z0-9_.-]+", instance):
|
| 77 |
+
raise ValueError(f"Invalid instance ID: {instance}")
|
| 78 |
+
instances[instance] = pair
|
| 79 |
+
if not instances:
|
| 80 |
+
return
|
| 81 |
+
quoted = ",".join("'" + instance + "'" for instance in sorted(instances))
|
| 82 |
+
parquet = Path(source_parquet).resolve().as_posix().replace("'", "''")
|
| 83 |
+
query = ("SELECT instance_id,base_commit,patch FROM read_parquet('"
|
| 84 |
+
+ parquet + "') WHERE instance_id IN (" + quoted + ")")
|
| 85 |
+
response = subprocess.run(["duckdb", "-json", "-c", query], check=True,
|
| 86 |
+
capture_output=True, text=True)
|
| 87 |
+
source_rows = {row["instance_id"]: row for row in json.loads(response.stdout)}
|
| 88 |
+
errors = []
|
| 89 |
+
for instance, pair in instances.items():
|
| 90 |
+
source = source_rows.get(instance)
|
| 91 |
+
if not source:
|
| 92 |
+
errors.append({"instance_id": instance, "reason": "missing source patch"})
|
| 93 |
+
continue
|
| 94 |
+
if pair["before"]["revision"] != source["base_commit"]:
|
| 95 |
+
errors.append({"instance_id": instance, "reason": "base commit mismatch"})
|
| 96 |
+
continue
|
| 97 |
+
repo = pair["repository"]
|
| 98 |
+
slug = repo.replace("/", "__")
|
| 99 |
+
git_dir = root / "git" / slug
|
| 100 |
+
checkout = root / "checkouts" / slug / pair["after"]["revision"]
|
| 101 |
+
patch_file = root / "patches" / f"{instance}.patch"
|
| 102 |
+
patch_file.parent.mkdir(parents=True, exist_ok=True)
|
| 103 |
+
patch_file.write_text(source["patch"], encoding="utf-8")
|
| 104 |
+
try:
|
| 105 |
+
if not git_dir.exists():
|
| 106 |
+
git_dir.parent.mkdir(parents=True, exist_ok=True)
|
| 107 |
+
subprocess.run(["git", "clone", "--filter=blob:none", "--no-checkout",
|
| 108 |
+
f"https://github.com/{repo}.git", str(git_dir)], check=True,
|
| 109 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
| 110 |
+
have = subprocess.run(
|
| 111 |
+
["git", "-C", str(git_dir), "cat-file", "-e",
|
| 112 |
+
f"{source['base_commit']}^{{commit}}"],
|
| 113 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
| 114 |
+
).returncode == 0
|
| 115 |
+
if not have:
|
| 116 |
+
subprocess.run(["git", "-C", str(git_dir), "fetch", "origin",
|
| 117 |
+
source["base_commit"]], check=True,
|
| 118 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
| 119 |
+
if not checkout.exists():
|
| 120 |
+
checkout.parent.mkdir(parents=True, exist_ok=True)
|
| 121 |
+
subprocess.run(["git", "-C", str(git_dir), "worktree", "add", "--detach",
|
| 122 |
+
str(checkout), source["base_commit"]], check=True,
|
| 123 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
| 124 |
+
subprocess.run(["git", "-C", str(checkout), "apply", "--whitespace=nowarn",
|
| 125 |
+
str(patch_file)], check=True,
|
| 126 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
| 127 |
+
except subprocess.CalledProcessError as error:
|
| 128 |
+
errors.append({"instance_id": instance,
|
| 129 |
+
"reason": f"{error.cmd[0]} exited {error.returncode}"})
|
| 130 |
+
(root / "patch-errors.json").write_text(json.dumps(errors, indent=2) + "\n")
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
def prepare_sources(pairs, root):
|
| 134 |
+
tasks = defaultdict(set)
|
| 135 |
+
for domain, group in pairs.items():
|
| 136 |
+
for pair in group:
|
| 137 |
+
repo = pair["repository"]
|
| 138 |
+
language = LANGUAGES[pair["language"].lower()]
|
| 139 |
+
for role in ("before", "after"):
|
| 140 |
+
tasks[(repo, pair[role]["revision"], language)].add(domain)
|
| 141 |
+
|
| 142 |
+
sources = {}
|
| 143 |
+
errors = []
|
| 144 |
+
for repo, revision, language in sorted(tasks):
|
| 145 |
+
if not re.fullmatch(r"[0-9a-f]{40}", revision):
|
| 146 |
+
errors.append({"repository": repo, "revision": revision,
|
| 147 |
+
"reason": "not a Git commit"})
|
| 148 |
+
continue
|
| 149 |
+
slug = repo.replace("/", "__")
|
| 150 |
+
git_dir = root / "git" / slug
|
| 151 |
+
checkout = root / "checkouts" / slug / revision
|
| 152 |
+
try:
|
| 153 |
+
if not git_dir.exists():
|
| 154 |
+
git_dir.parent.mkdir(parents=True, exist_ok=True)
|
| 155 |
+
subprocess.run(
|
| 156 |
+
["git", "clone", "--filter=blob:none", "--no-checkout",
|
| 157 |
+
f"https://github.com/{repo}.git", str(git_dir)],
|
| 158 |
+
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE,
|
| 159 |
+
)
|
| 160 |
+
if not checkout.exists():
|
| 161 |
+
checkout.parent.mkdir(parents=True, exist_ok=True)
|
| 162 |
+
have = subprocess.run(
|
| 163 |
+
["git", "-C", str(git_dir), "cat-file", "-e", f"{revision}^{{commit}}"],
|
| 164 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
| 165 |
+
).returncode == 0
|
| 166 |
+
if not have:
|
| 167 |
+
subprocess.run(["git", "-C", str(git_dir), "fetch", "origin", revision],
|
| 168 |
+
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
| 169 |
+
subprocess.run(["git", "-C", str(git_dir), "worktree", "add", "--detach",
|
| 170 |
+
str(checkout), revision], check=True,
|
| 171 |
+
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
| 172 |
+
sources[(repo, revision, language)] = (checkout, tasks[(repo, revision, language)])
|
| 173 |
+
except subprocess.CalledProcessError as error:
|
| 174 |
+
errors.append({"repository": repo, "revision": revision,
|
| 175 |
+
"reason": f"{error.cmd[0]} exited {error.returncode}"})
|
| 176 |
+
(root / "source-errors.json").write_text(json.dumps(errors, indent=2) + "\n")
|
| 177 |
+
return sources
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
def docker(args, name, *command):
|
| 181 |
+
return ["docker", "run", "--rm", "--name", name,
|
| 182 |
+
"-v", f"{Path(args.codeql).resolve()}:/opt/codeql:ro",
|
| 183 |
+
"-v", f"{Path(args.root).resolve()}:/work", args.image,
|
| 184 |
+
"/opt/codeql/codeql", *command]
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
def scan_one(args, task):
|
| 188 |
+
(repo, revision, language), (checkout, domains) = task
|
| 189 |
+
root = Path(args.root).resolve()
|
| 190 |
+
slug = repo.replace("/", "__")
|
| 191 |
+
stem = f"{slug}-{revision[:12]}-{language}"
|
| 192 |
+
db = root / "dbs" / stem
|
| 193 |
+
log_dir = root / "logs"
|
| 194 |
+
result = {"repository": repo, "revision": revision, "language": language,
|
| 195 |
+
"domains": sorted(domains)}
|
| 196 |
+
if not (db / f"db-{language}").exists():
|
| 197 |
+
if db.exists():
|
| 198 |
+
shutil.rmtree(db)
|
| 199 |
+
container = f"codeql-create-{stem}".lower()
|
| 200 |
+
code, seconds = run(docker(args, container, "database", "create", f"/work/dbs/{stem}",
|
| 201 |
+
f"--language={language}", "--build-mode=none",
|
| 202 |
+
f"--source-root=/work/checkouts/{slug}/{revision}",
|
| 203 |
+
"--threads=4", "--ram=4096"),
|
| 204 |
+
log_dir / f"{stem}-create.log", args.scan_timeout, container)
|
| 205 |
+
result["create_seconds"] = seconds
|
| 206 |
+
if code:
|
| 207 |
+
result["error"] = f"database create exit {code}"
|
| 208 |
+
return result
|
| 209 |
+
for domain in sorted(domains):
|
| 210 |
+
sarif = root / "sarif" / domain / f"{stem}.sarif"
|
| 211 |
+
if sarif.exists():
|
| 212 |
+
continue
|
| 213 |
+
sarif.parent.mkdir(parents=True, exist_ok=True)
|
| 214 |
+
suite = "security-extended" if domain == "security" else "security-and-quality"
|
| 215 |
+
query = (f"/work/packs/codeql/{language}-queries/{PACKS[language]}/"
|
| 216 |
+
f"codeql-suites/{language}-{suite}.qls")
|
| 217 |
+
container = f"codeql-{domain}-{stem}".lower()
|
| 218 |
+
code, seconds = run(docker(args, container, "database", "analyze", f"/work/dbs/{stem}",
|
| 219 |
+
query, "--format=sarif-latest",
|
| 220 |
+
f"--output=/work/sarif/{domain}/{stem}.sarif",
|
| 221 |
+
"--threads=4", "--ram=4096"),
|
| 222 |
+
log_dir / f"{stem}-{domain}-analyze.log", args.scan_timeout,
|
| 223 |
+
container)
|
| 224 |
+
result[f"{domain}_analyze_seconds"] = seconds
|
| 225 |
+
if code:
|
| 226 |
+
result["error"] = f"{domain} analyze exit {code}"
|
| 227 |
+
return result
|
| 228 |
+
result["ok"] = True
|
| 229 |
+
return result
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
def scan(args):
|
| 233 |
+
root = Path(args.root).resolve()
|
| 234 |
+
(root / "dbs").mkdir(parents=True, exist_ok=True)
|
| 235 |
+
pairs = selected_pairs(args)
|
| 236 |
+
prepare_rebench_patches(pairs, root, args.rebench_parquet)
|
| 237 |
+
sources = prepare_sources(pairs, root)
|
| 238 |
+
print(f"Fixed cohort: {len(pairs['bug'])} bug pairs, "
|
| 239 |
+
f"{len(pairs['security'])} security pairs, {len(sources)} databases", flush=True)
|
| 240 |
+
manifest = {domain: [p["pair_id"] for p in group] for domain, group in pairs.items()}
|
| 241 |
+
(root / "cohort-pair-ids.json").write_text(json.dumps(manifest, indent=2) + "\n")
|
| 242 |
+
with concurrent.futures.ThreadPoolExecutor(max_workers=args.jobs) as executor:
|
| 243 |
+
for result in concurrent.futures.as_completed(
|
| 244 |
+
[executor.submit(scan_one, args, task) for task in sources.items()]
|
| 245 |
+
):
|
| 246 |
+
item = result.result()
|
| 247 |
+
with (root / "scan-status.jsonl").open("a", encoding="utf-8") as stream:
|
| 248 |
+
stream.write(json.dumps(item, sort_keys=True) + "\n")
|
| 249 |
+
print(f"{'OK' if item.get('ok') else 'FAILED'} "
|
| 250 |
+
f"{item['repository']} {item['revision'][:12]} "
|
| 251 |
+
f"{','.join(item['domains'])}", flush=True)
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
def method_span(side):
|
| 255 |
+
lines = [int(match) for match in re.findall(r"(?m)^L(\d+)\|",
|
| 256 |
+
side["state"]["method"]["source"])]
|
| 257 |
+
return (min(lines), max(lines)) if lines else None
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
def source_matches(side, source_path):
|
| 261 |
+
content = source_path.read_text(errors="replace").replace("\r\n", "\n")
|
| 262 |
+
needle = side["source"].replace("\r\n", "\n").strip()
|
| 263 |
+
start = content.find(needle)
|
| 264 |
+
return start >= 0 and content.count("\n", 0, start) + 1 == method_span(side)[0]
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
@lru_cache(maxsize=128)
|
| 268 |
+
def archived_sources(archive):
|
| 269 |
+
with ZipFile(archive) as zipped:
|
| 270 |
+
return set(zipped.namelist())
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
def codeql_alert(sarif, side, domain):
|
| 274 |
+
path = side["path"].lstrip("/")
|
| 275 |
+
span = method_span(side)
|
| 276 |
+
if not span:
|
| 277 |
+
raise ValueError(f"Missing line-numbered method: {path}")
|
| 278 |
+
data = json.loads(sarif.read_text())
|
| 279 |
+
alerts = []
|
| 280 |
+
for run_data in data["runs"]:
|
| 281 |
+
rule_tags = {
|
| 282 |
+
rule["id"]: set(rule.get("properties", {}).get("tags", []))
|
| 283 |
+
for rule in run_data["tool"]["driver"].get("rules", [])
|
| 284 |
+
}
|
| 285 |
+
for finding in run_data.get("results", []):
|
| 286 |
+
tags = rule_tags.get(finding["ruleId"], set())
|
| 287 |
+
if domain == "security" and "security" not in tags:
|
| 288 |
+
continue
|
| 289 |
+
if domain == "bug" and not tags.intersection(
|
| 290 |
+
("correctness", "reliability", "security")
|
| 291 |
+
):
|
| 292 |
+
continue
|
| 293 |
+
for location in finding.get("locations", [])[:1]:
|
| 294 |
+
physical = location.get("physicalLocation", {})
|
| 295 |
+
uri = physical.get("artifactLocation", {}).get("uri", "")
|
| 296 |
+
region = physical.get("region", {})
|
| 297 |
+
if uri.lstrip("/") != path or "startLine" not in region:
|
| 298 |
+
continue
|
| 299 |
+
start = region["startLine"]
|
| 300 |
+
end = region.get("endLine", start)
|
| 301 |
+
if start <= span[1] and end >= span[0]:
|
| 302 |
+
alerts.append(finding["ruleId"])
|
| 303 |
+
return sorted(set(alerts))
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
def metrics(items):
|
| 307 |
+
items = list(items)
|
| 308 |
+
tp = sum(label and alert for label, alert in items)
|
| 309 |
+
fp = sum(not label and alert for label, alert in items)
|
| 310 |
+
fn = sum(label and not alert for label, alert in items)
|
| 311 |
+
tn = sum(not label and not alert for label, alert in items)
|
| 312 |
+
precision = tp / (tp + fp) if tp + fp else None
|
| 313 |
+
recall = tp / (tp + fn) if tp + fn else 0.0
|
| 314 |
+
fpr = fp / (fp + tn) if fp + tn else 0.0
|
| 315 |
+
f1 = (2 * precision * recall / (precision + recall)
|
| 316 |
+
if precision is not None and precision + recall else 0.0)
|
| 317 |
+
return {"tp": tp, "fp": fp, "fn": fn, "tn": tn, "precision": precision,
|
| 318 |
+
"recall": recall, "fpr": fpr, "f1": f1, "recall_minus_fpr": recall - fpr}
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
def score(args):
|
| 322 |
+
root = Path(args.root).resolve()
|
| 323 |
+
selected = selected_pairs(args)
|
| 324 |
+
all_results = {}
|
| 325 |
+
for domain, group in selected.items():
|
| 326 |
+
jev = {(r["pair_id"], r["role"]): r for r in
|
| 327 |
+
rows(Path(args.predictions) / domain / "jev.jsonl")}
|
| 328 |
+
output = []
|
| 329 |
+
unavailable = []
|
| 330 |
+
for pair in group:
|
| 331 |
+
decisions = []
|
| 332 |
+
for role in ("before", "after"):
|
| 333 |
+
side = pair[role]
|
| 334 |
+
lang = LANGUAGES[pair["language"].lower()]
|
| 335 |
+
stem = f"{pair['repository'].replace('/', '__')}-{side['revision'][:12]}-{lang}"
|
| 336 |
+
sarif = root / "sarif" / domain / f"{stem}.sarif"
|
| 337 |
+
source_path = (root / "checkouts" / pair["repository"].replace("/", "__")
|
| 338 |
+
/ side["revision"] / side["path"])
|
| 339 |
+
if not sarif.exists() or (pair["pair_id"], role) not in jev:
|
| 340 |
+
reason = ("source snapshot unavailable" if not source_path.exists()
|
| 341 |
+
else "CodeQL analysis unavailable" if not sarif.exists()
|
| 342 |
+
else "Jev prediction unavailable")
|
| 343 |
+
unavailable.append({"pair_id": pair["pair_id"], "role": role,
|
| 344 |
+
"reason": reason})
|
| 345 |
+
decisions = []
|
| 346 |
+
break
|
| 347 |
+
archive = root / "dbs" / stem / "src.zip"
|
| 348 |
+
archived_name = (f"work/checkouts/{pair['repository'].replace('/', '__')}/"
|
| 349 |
+
f"{side['revision']}/{side['path']}")
|
| 350 |
+
if not source_path.exists():
|
| 351 |
+
unavailable.append({"pair_id": pair["pair_id"], "role": role,
|
| 352 |
+
"reason": "source snapshot unavailable"})
|
| 353 |
+
decisions = []
|
| 354 |
+
break
|
| 355 |
+
if (not archive.exists()
|
| 356 |
+
or archived_name not in archived_sources(archive)
|
| 357 |
+
or not source_matches(side, source_path)):
|
| 358 |
+
unavailable.append({"pair_id": pair["pair_id"], "role": role,
|
| 359 |
+
"reason": "target source not verified in CodeQL database"})
|
| 360 |
+
decisions = []
|
| 361 |
+
break
|
| 362 |
+
rules = codeql_alert(sarif, side, domain)
|
| 363 |
+
label = int(side["labels"][domain])
|
| 364 |
+
decisions.append({"role": role, "label": label, "codeql_alert": bool(rules),
|
| 365 |
+
"codeql_rules": rules,
|
| 366 |
+
"jev_alert": bool(jev[(pair["pair_id"], role)]["alert"]),
|
| 367 |
+
"jev_score": jev[(pair["pair_id"], role)]["score"]})
|
| 368 |
+
if decisions:
|
| 369 |
+
output.append({"pair_id": pair["pair_id"], "repository": pair["repository"],
|
| 370 |
+
"language": pair["language"], "decisions": decisions})
|
| 371 |
+
model_scores = {}
|
| 372 |
+
for model in ("codeql", "jev"):
|
| 373 |
+
model_scores[model] = metrics(
|
| 374 |
+
(d["label"], d[f"{model}_alert"]) for row in output for d in row["decisions"]
|
| 375 |
+
)
|
| 376 |
+
all_results[domain] = {"pairs": len(output), "requested_pairs": len(group),
|
| 377 |
+
"missing_sides": unavailable, "models": model_scores}
|
| 378 |
+
out = root / f"{domain}-codeql-comparison.jsonl"
|
| 379 |
+
out.write_text("".join(json.dumps(r, sort_keys=True) + "\n" for r in output))
|
| 380 |
+
(root / "codeql-comparison-results.json").write_text(
|
| 381 |
+
json.dumps(all_results, indent=2, sort_keys=True) + "\n"
|
| 382 |
+
)
|
| 383 |
+
print(json.dumps(all_results, indent=2))
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
def main():
|
| 387 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 388 |
+
parser.add_argument("operation", choices=("scan", "score"))
|
| 389 |
+
parser.add_argument("--root", required=True)
|
| 390 |
+
parser.add_argument("--data", required=True, help="directory with bug/security/benchmark.jsonl")
|
| 391 |
+
parser.add_argument("--predictions", required=True, help="directory with bug/security/jev.jsonl")
|
| 392 |
+
parser.add_argument("--cohort", default=str(Path(__file__).with_name("codeql-cohort.json")))
|
| 393 |
+
parser.add_argument("--codeql", help="unpacked CodeQL CLI directory")
|
| 394 |
+
parser.add_argument("--rebench-parquet", help="SWE-rebench-V2 source Parquet with gold patches")
|
| 395 |
+
parser.add_argument("--image", default="node:22-bookworm")
|
| 396 |
+
parser.add_argument("--jobs", type=int, default=4)
|
| 397 |
+
parser.add_argument("--scan-timeout", type=int, default=600,
|
| 398 |
+
help="seconds allowed per CodeQL database or analysis stage")
|
| 399 |
+
args = parser.parse_args()
|
| 400 |
+
if args.operation == "scan":
|
| 401 |
+
if not args.codeql:
|
| 402 |
+
parser.error("--codeql is required for scanning")
|
| 403 |
+
scan(args)
|
| 404 |
+
else:
|
| 405 |
+
score(args)
|
| 406 |
+
|
| 407 |
+
|
| 408 |
+
if __name__ == "__main__":
|
| 409 |
+
main()
|
test_codeql_compare.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import sys
|
| 3 |
+
import tempfile
|
| 4 |
+
import unittest
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
|
| 7 |
+
from codeql_compare import codeql_alert, method_span, metrics, run
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class CodeQLComparisonTests(unittest.TestCase):
|
| 11 |
+
def test_alert_requires_primary_location_inside_method_and_relevant_tag(self):
|
| 12 |
+
side = {
|
| 13 |
+
"path": "src/example.py",
|
| 14 |
+
"state": {"method": {"source": "L0010| def check():\nL0011| return 1"}},
|
| 15 |
+
}
|
| 16 |
+
sarif = {
|
| 17 |
+
"runs": [{
|
| 18 |
+
"tool": {"driver": {"rules": [
|
| 19 |
+
{"id": "py/security", "properties": {"tags": ["security"]}},
|
| 20 |
+
{"id": "py/style", "properties": {"tags": ["maintainability"]}},
|
| 21 |
+
]}},
|
| 22 |
+
"results": [
|
| 23 |
+
{"ruleId": "py/security", "locations": [{"physicalLocation": {
|
| 24 |
+
"artifactLocation": {"uri": "src/example.py"},
|
| 25 |
+
"region": {"startLine": 11}}}]},
|
| 26 |
+
{"ruleId": "py/security", "locations": [{"physicalLocation": {
|
| 27 |
+
"artifactLocation": {"uri": "src/example.py"},
|
| 28 |
+
"region": {"startLine": 30}}}]},
|
| 29 |
+
{"ruleId": "py/style", "locations": [{"physicalLocation": {
|
| 30 |
+
"artifactLocation": {"uri": "src/example.py"},
|
| 31 |
+
"region": {"startLine": 10}}}]},
|
| 32 |
+
],
|
| 33 |
+
}],
|
| 34 |
+
}
|
| 35 |
+
with tempfile.TemporaryDirectory() as directory:
|
| 36 |
+
file = Path(directory) / "result.sarif"
|
| 37 |
+
file.write_text(json.dumps(sarif))
|
| 38 |
+
self.assertEqual(method_span(side), (10, 11))
|
| 39 |
+
self.assertEqual(codeql_alert(file, side, "security"), ["py/security"])
|
| 40 |
+
self.assertEqual(codeql_alert(file, side, "bug"), ["py/security"])
|
| 41 |
+
|
| 42 |
+
def test_counts_include_false_negatives_and_clean_methods(self):
|
| 43 |
+
result = metrics(iter([(1, True), (1, False), (0, True), (0, False)]))
|
| 44 |
+
self.assertEqual([result[key] for key in ("tp", "fp", "fn", "tn")],
|
| 45 |
+
[1, 1, 1, 1])
|
| 46 |
+
self.assertEqual(result["f1"], 0.5)
|
| 47 |
+
self.assertIsNone(metrics([(1, False), (0, False)])["precision"])
|
| 48 |
+
|
| 49 |
+
def test_scan_stage_has_bounded_runtime(self):
|
| 50 |
+
with tempfile.TemporaryDirectory() as directory:
|
| 51 |
+
code, _ = run([sys.executable, "-c", "import time; time.sleep(2)"],
|
| 52 |
+
Path(directory) / "stage.log", timeout=0.1)
|
| 53 |
+
self.assertEqual(code, 124)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
if __name__ == "__main__":
|
| 57 |
+
unittest.main()
|