{"meta":{"title":"Go CodeQLクエリによるコード品質","intro":"CodeQL が Go で記述されたコードのコード品質を分析するために使用するクエリを調べる。","product":"セキュリティとコードの品質","breadcrumbs":[{"href":"/ja/enterprise-cloud@latest/code-security","title":"セキュリティとコードの品質"},{"href":"/ja/enterprise-cloud@latest/code-security/reference","title":"リファレンス"},{"href":"/ja/enterprise-cloud@latest/code-security/reference/code-quality","title":"コードの品質"},{"href":"/ja/enterprise-cloud@latest/code-security/reference/code-quality/codeql-queries","title":"CodeQL クエリ"},{"href":"/ja/enterprise-cloud@latest/code-security/reference/code-quality/codeql-queries/go-queries","title":"Go クエリ"}],"documentType":"article"},"body":"# Go CodeQLクエリによるコード品質\n\nCodeQL が Go で記述されたコードのコード品質を分析するために使用するクエリを調べる。\n\nCode Quality は、以下の CodeQL クエリを使用して Go コードを分析し、コード品質に関する問題を検出します。\n\n* あなたの**既定のブランチ**の結果が、リポジトリの \"標準の結果\" ダッシュボードに表示されます。\n* **Pull requests (プル リクエスト)** は、発見された事項とともに、`github-code-quality[bot]` によるコメントとして表示されます\n\nCopilot の自動修正 の提案は、可能な場合に検出結果に対して提供されます。\n\n<div class=\"ghd-tool rowheaders\">\n\n| クエリ名 | カテゴリ | Severity |\n| --- | --- | --- |\n| [フィールドへの無駄な割り当て](https://codeql.github.com/codeql-query-help/go/go-useless-assignment-to-field/) | 保守性 | Warnung |\n| [ローカル変数への無駄な代入](https://codeql.github.com/codeql-query-help/go/go-useless-assignment-to-local/) | 保守性 | Warnung |\n| [ビットごとの排他的か、指数のように使用されます](https://codeql.github.com/codeql-query-help/go/go-mistyped-exponentiation/) | Reliability | Warnung |\n| [同じ値の比較](https://codeql.github.com/codeql-query-help/go/go-comparison-of-identical-expressions/) | Reliability | Warnung |\n| [定数長の比較](https://codeql.github.com/codeql-query-help/go/go-constant-length-comparison/) | Reliability | Warnung |\n| ['if' 分岐を複製する](https://codeql.github.com/codeql-query-help/go/go-duplicate-branches/) | Reliability | Warnung |\n| [重複する 'if' 条件](https://codeql.github.com/codeql-query-help/go/go-duplicate-condition/) | Reliability | エラー |\n| [重複したスイッチケース](https://codeql.github.com/codeql-query-help/go/go-duplicate-switch-case/) | Reliability | エラー |\n| [式は何も影響を及ぼしません](https://codeql.github.com/codeql-query-help/go/go-useless-expression/) | Reliability | Warnung |\n| [同一オペランド](https://codeql.github.com/codeql-query-help/go/go-redundant-operation/) | Reliability | Warnung |\n| [不可能なインタフェースのnil値チェック](https://codeql.github.com/codeql-query-help/go/go-impossible-interface-nil-check/) | Reliability | Warnung |\n| [for ループの方向が不一致](https://codeql.github.com/codeql-query-help/go/go-inconsistent-loop-direction/) | Reliability | エラー |\n| [エラー チェックがありません](https://codeql.github.com/codeql-query-help/go/go-missing-error-check/) | Reliability | Warnung |\n| [長さに対するオフバイワン比較](https://codeql.github.com/codeql-query-help/go/go-index-out-of-bounds/) | Reliability | エラー |\n| [回復するための冗長呼び出し](https://codeql.github.com/codeql-query-help/go/go-redundant-recover/) | Reliability | Warnung |\n| [負の値の冗長チェック](https://codeql.github.com/codeql-query-help/go/go-negative-length-check/) | Reliability | Warnung |\n| [自己割り当て](https://codeql.github.com/codeql-query-help/go/go-redundant-assignment/) | Reliability | Warnung |\n| [範囲外にシフト](https://codeql.github.com/codeql-query-help/go/go-shift-out-of-range/) | Reliability | Warnung |\n| [到達できないステートメント](https://codeql.github.com/codeql-query-help/go/go-unreachable-statement/) | Reliability | Warnung |\n| [空白文字が演算子の優先順位と矛盾する](https://codeql.github.com/codeql-query-help/go/go-whitespace-contradicts-precedence/) | Reliability | Warnung |\n| [ラップされたエラーは常に nil です](https://codeql.github.com/codeql-query-help/go/go-unexpected-nil-value/) | Reliability | Warnung |\n| [エラー処理をせずに閉じた書き込み可能なファイルハンドル](https://codeql.github.com/codeql-query-help/go/go-unhandled-writable-file-close/) | Reliability | Warnung |\n\n</div>"}