8000 JS: Add experimental variants of common security queries with more sources by erik-krogh · Pull Request #11582 · github/codeql · GitHub
[go: up one dir, main page]

Skip to content

JS: Add experimental variants of common security queries with more sources #11582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
QL: add getQueryName to QueryDoc
  • Loading branch information
erik-krogh committed Dec 19, 2022
commit 2f84b21c7f769d9c35363ac22594a4b5fb8afff7
5 changes: 5 additions & 0 deletions ql/ql/src/codeql_ql/ast/Ast.qll
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ class QueryDoc extends QLDoc {
result = this.getContents().regexpCapture("(?s).*@kind ([\\w-]+)\\s.*", 1)
}

/** Gets the @name for the query */
string getQueryName() {
result = this.getContents().regexpCapture("(?s).*@name ([\\w-\\s]+)(?=\\n).*", 1)
}

/** Gets the id part (without language) of the @id */
string getQueryId() {
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-]+)\\s.*", 2)
Expand Down
0