{"meta":{"title":"使用路径查询探究数据流","intro":"通过运行路径查询和分析数据流来检测潜在的漏洞。","product":"安全性和代码质量","breadcrumbs":[{"href":"/zh/code-security","title":"安全性和代码质量"},{"href":"/zh/code-security/how-tos","title":"How-tos"},{"href":"/zh/code-security/how-tos/find-and-fix-code-vulnerabilities","title":"查找和修复代码漏洞"},{"href":"/zh/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-vs-code","title":"从 VS Code 扫描"},{"href":"/zh/code-security/how-tos/find-and-fix-code-vulnerabilities/scan-from-vs-code/exploring-data-flow-with-path-queries","title":"探究数据流"}],"documentType":"article"},"body":"# 使用路径查询探究数据流\n\n通过运行路径查询和分析数据流来检测潜在的漏洞。\n\n## 先决条件\n\n在有效地使用路径查询之前，应了解数据流分析的基础知识。 请参阅文档中的[关于数据流分析](https://codeql.github.com/docs/writing-codeql-queries/about-data-flow-analysis/)CodeQL。\n\n## 在本地 VS Code 运行路径查询\n\n1. 在VS Code中打开路径查询。 路径查询是具有 CodeQL 属性 `@kind path-problem`的查询。\n2. 在打开查询的窗口中右键单击，然后选择 **CodeQL：在所选数据库上运行查询**。 你还可以从VS Code Command Palette运行此功能。\n3. 查询运行完毕后，可以在“结果”视图（下拉菜单中 `alerts` 的下方）中看到结果。 每个查询结果描述源和接收器之间的信息流。\n4. 展开结果以查看数据流动的各个步骤。\n5. 单击每个步骤以在源代码中跳转到该步骤，并进一步调查问题。\n\n## 后续步骤\n\n可以使用“变体分析存储库”视图针对最多 1,000 个存储库 GitHub.com运行查询。 请参阅“[通过多库变体分析大规模运行 CodeQL 查询](/zh/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis)”。\n\n若要开始编写自己的路径查询，请参阅文档中[的“创建路径查询](https://codeql.github.com/docs/writing-codeql-queries/creating-path-queries/#creating-path-queries)CodeQL”。"}