Skip to main content

이 버전의 GitHub Enterprise Server는 다음 날짜에 중단됩니다. 2026-04-09. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

Creating a custom query

You can work from a template to write your own code to create a custom query to analyze a specific language.

이 기사에서

You can write custom CodeQL queries to find specific issues relevant to your own project. This is optional, and the github/codeql repository contains a large number of example queries you can use instead.

Creating a custom query

You create a new query file from a template for a given language, which imports the standard libraries for analyzing that language.

  1. In the extension sidebar, open the "Queries" view, then click the Create query icon.

  2. In the VS Code Command Palette, select the target language for your query. If you've chosen not to create your custom query in an existing directory, selecting a language will autogenerate a directory labeled codeql-custom-queries-LANGUAGE, where LANGUAGE is the name of the selected language. A query template labeled example.ql will then be added to the existing or autogenerated directory.

  3. In the template, write your custom query, then save the file. Once your query is finished, you can run it from the "Queries" view.

Further reading

You can read about how to write queries for supported languages in the CodeQL documentation: