{"meta":{"title":"用于代码质量的 Ruby CodeQL 查询","intro":"浏览 CodeQL 使用的查询，以分析用 Ruby 编写的代码的质量。","product":"安全性和代码质量","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/code-security","title":"安全性和代码质量"},{"href":"/zh/enterprise-cloud@latest/code-security/reference","title":"Reference"},{"href":"/zh/enterprise-cloud@latest/code-security/reference/code-quality","title":"代码质量"},{"href":"/zh/enterprise-cloud@latest/code-security/reference/code-quality/codeql-queries","title":"CodeQL 查询"},{"href":"/zh/enterprise-cloud@latest/code-security/reference/code-quality/codeql-queries/ruby-queries","title":"Ruby 查询"}],"documentType":"article"},"body":"# 用于代码质量的 Ruby CodeQL 查询\n\n浏览 CodeQL 使用的查询，以分析用 Ruby 编写的代码的质量。\n\n<!-- TRANSLATION_FALLBACK prop=markdown type=ParseError line=1 col=1 msg=\"tag {% rowheaders %} not closed\" -->\nCode Quality uses the following CodeQL queries to analyze Ruby code and detect code quality issues on:\n\n* Your **default branch**, with results shown on the repository's \"Standard findings\" dashboard\n* **Pull requests**, with findings shown as comments made by `github-code-quality[bot]`\n\nCopilot Autofix suggestions are provided for findings where possible.\n\n<div class=\"ghd-tool rowheaders\">\n\n| Query name | Category | Severity |\n| --- | --- | --- |\n| [Useless assignment to local variable](https://codeql.github.com/codeql-query-help/ruby/rb-useless-assignment-to-local/) | Maintainability | Warning |\n| [Database query in a loop](https://codeql.github.com/codeql-query-help/ruby/rb-database-query-in-loop/) | Reliability | Info |\n| [Potentially uninitialized local variable](https://codeql.github.com/codeql-query-help/ruby/rb-uninitialized-local-variable/) | Reliability | Error |\n\n</div>"}