{"id":372370,"date":"2023-07-17T03:00:00","date_gmt":"2023-07-17T02:00:00","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&#038;p=372370"},"modified":"2023-07-18T07:51:16","modified_gmt":"2023-07-18T06:51:16","slug":"qodana-c","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2023\/07\/17\/qodana-c\/","title":{"rendered":"\u4f7f\u7528 Qodana \u63d0\u5347 C# \u4ee3\u7801\u8d28\u91cf\uff1a\u8fc8\u5411\u5b8c\u7f8e"},"content":{"rendered":"<p>JetBrains IDE \u4ee5\u652f\u6301\u591a\u79cd\u8bed\u8a00\u7684\u5f3a\u5927\u9759\u6001\u4ee3\u7801\u5206\u6790\u800c\u95fb\u540d\u3002&nbsp;\u5728 <a href=\"https:\/\/www.jetbrains.com.cn\/qodana\/\" target=\"_blank\" rel=\"noopener\">Qodana<\/a> \u53d1\u5e03\u540e\uff0c\u6211\u4eec\u5c06\u8fd9\u4e9b\u77e5\u8bc6\u7edf\u4e00\u5230\u4e00\u4e2a\u4e2d\u592e\u4ee3\u7801\u8d28\u91cf\u5e73\u53f0\uff0c\u4e5f\u662f\u6bcf\u4e2a\u5f00\u53d1\u6d41\u7a0b\u7684\u6838\u5fc3 \u2013 \u60a8\u6700\u559c\u6b22\u7684 CI\/CD \u5de5\u5177\u3002<\/p>\n<p>Qodana \u7531\u63d0\u4ea4\u6216\u62c9\u53d6\u8bf7\u6c42\u89e6\u53d1\uff0c\u53ef\u4e3a\u6240\u6709\u53d1\u73b0\u7684\u4ee3\u7801\u8d28\u91cf\u548c\u5b89\u5168\u95ee\u9898\u751f\u6210\u5168\u9762\u7684\u5206\u6790\u62a5\u544a (<a href=\"https:\/\/sarifweb.azurewebsites.net\/\" target=\"_blank\" rel=\"noopener\">SARIF<\/a>)\u3002&nbsp;Qodana \u8ba9\u8fd9\u4e9b\u62a5\u544a\u53ef\u4f9b\u5f00\u53d1\u8005\u3001QA \u5de5\u7a0b\u5e08\u56e2\u961f\u4ee5\u53ca\u5b89\u5168\u7ecf\u7406\u548c\u6cd5\u52a1\/\u5408\u89c4\u90e8\u95e8\u8f7b\u677e\u8bbf\u95ee\u3002<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-165112\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2021\/07\/qodana_social_image.png\" alt=\"Qodana \u6a2a\u5e45\" width=\"1280\" height=\"720\"><\/figure>\n<p>\u6700\u8fd1\uff0cQodana \u5411\u6211\u4eec\u7684 .NET \u5de5\u5177\u7cfb\u5217\u8fc8\u51fa\u4e86\u7b2c\u4e00\u6b65\uff0c\u5927\u5bb6\u53ef\u80fd\u5df2\u7ecf\u731c\u5230\uff0c\u5b83\u4e3a Rider \u63d0\u4f9b\u4e86\u51fa\u8272\u96c6\u6210\u3002&nbsp;\u5206\u6790\u672c\u8eab\u7684\u57fa\u7840\u662f\u719f\u6089\u7684 <em>InspectCode<\/em>\uff0c<a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2016\/10\/04\/establishing-a-zero-warning-policy-with-resharpers-solution-wide-analysis\/\"><em>Establishing a zero-warning policy with ReSharper\u2019s solution-wide analysis<\/em><\/a> \u6216 <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2020\/07\/16\/resharper-command-line-tools-cross-platform-and-global-tools\/\"><em>ReSharper Command-Line Tools \u2013 Cross-Platform and Global Tools<\/em><\/a> \u7b49\u535a\u6587\u5df2\u7ecf\u5bf9\u5176\u6709\u8fc7\u4ecb\u7ecd\u3002&nbsp;InspectCode \u8fd0\u884c\u7684\u5206\u6790\u4e0e\u63a2\u6d4b Rider \u548c ReSharper \u4e2d\u4ee3\u7801\u95ee\u9898\u7684\u5206\u6790\u76f8\u540c\u3002&nbsp;\u4e0d\u8fc7\uff0c\u5728 CI\/CD \u4ee3\u7406\u4e0a\u5de5\u4f5c\u5177\u6709\u5de8\u5927\u4f18\u52bf\uff0c\u56e0\u4e3a<a href=\"https:\/\/www.jetbrains.com.cn\/help\/rider\/Code_Analysis__Solution-Wide_Analysis.html#enabling-solution-wide-analysis\" target=\"_blank\" rel=\"noreferrer noopener\">\u89e3\u51b3\u65b9\u6848\u7ea7\u5206\u6790<\/a>\u4e0d\u518d\u9700\u8981\u5728\u672c\u5730\u673a\u5668\u4e0a\u8fd0\u884c\uff0c\u8fd9\u610f\u5473\u7740\u66f4\u597d\u7684\u5f00\u53d1\u4f53\u9a8c\u3001\u54cd\u5e94\u80fd\u529b\u548c\u7535\u6c60\u5bff\u547d\u3002<\/p>\n<p>\u5982\u679c\u60a8\u60f3\u67e5\u770b Qodana \u5b9e\u65f6\u62a5\u544a\uff0c\u8bf7\u524d\u5f80 <a href=\"https:\/\/qodana.cloud\/projects\/AgRgk\/reports\/b894a\" target=\"_blank\" rel=\"noreferrer noopener\">FluentAssertions<\/a> \u6216 <a href=\"https:\/\/qodana.cloud\/projects\/3BBmd\/reports\/ObDG9\" target=\"_blank\" rel=\"noreferrer noopener\">NUKE<\/a> \u7684\u516c\u5f00\u62a5\u544a\u3002&nbsp;\u5982\u679c\u60a8\u60f3\u5728\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u5c1d\u8bd5 Qodana \u5e76\u8be6\u7ec6\u4e86\u89e3\u5176\u5728\u5404\u79cd CI\/CD \u73af\u5883\u548c Rider \u672c\u8eab\u4e2d\u7684\u4e13\u4e1a\u529f\u80fd\uff0c\u8bf7\u7ee7\u7eed\u9605\u8bfb\uff01<\/p>\n<h2 id=\"setting-up-qodana-for-net-projects\" class=\"wp-block-heading\">\u4e3a .NET \u9879\u76ee\u8bbe\u7f6e Qodana<\/h2>\n<p>Qodana \u5728 Docker \u5bb9\u5668\u4e2d\u8fd0\u884c\uff0c\u56e0\u6b64\u60a8\u5e94\u8be5\u5728\u672c\u5730\u548c CI\/CD \u73af\u5883\u4e2d\u5b89\u88c5 Docker\u3002&nbsp;\u5bf9\u4e8e\u672c\u5730\u4f53\u9a8c\uff0c\u8fd8\u5efa\u8bae<a href=\"https:\/\/github.com\/JetBrains\/qodana-cli#installation\" target=\"_blank\" rel=\"noreferrer noopener\">\u5b89\u88c5 Qodana CLI<\/a>\uff08\u60a8\u4e5f\u53ef\u4ee5<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/quick-start.html#quickstart-analyze-project-locally\" target=\"_blank\" rel=\"noreferrer noopener\">\u76f4\u63a5\u8c03\u7528 Docker<\/a>\uff09\uff1a<\/p>\n<ul>\n<li>\u5728 Windows \u4e0a\u4f7f\u7528 WinGet\uff1a<code>winget install -e --id JetBrains.QodanaCLI<\/code><\/li>\n<li>\u5728 Windows \u4e0a\u4f7f\u7528 Chocolatey\uff1a<code>choco install qodana<\/code><\/li>\n<li>\u5728 macOS \u4e0a\uff1a<code>brew install jetbrains\/utils\/qodana<\/code><\/li>\n<li>\u5728 Linux \u4e0a\uff1a<code>curl -fsSL https:\/\/jb.gg\/qodana-cli\/install | bash<\/code><\/li>\n<\/ul>\n<p>\u4e0b\u4e00\u6b65\uff0c\u60a8\u53ef\u4ee5\u8c03\u7528 <code>qodana init<\/code> \u6765\u89e6\u53d1\u8bbe\u7f6e\u5411\u5bfc\uff1a<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-363288\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/qodana-init.png\" alt=\"Qodana \u521d\u59cb\u5316\" width=\"1918\" height=\"752\"><\/figure>\n<p>\u9009\u62e9\u9002\u5f53\u7684 linter \u548c\u89e3\u51b3\u65b9\u6848\u6587\u4ef6\u540e\uff0cQodana \u5e94\u8be5\u4f1a\u521b\u5efa\u4e00\u4e2a <code>qodana.yml<\/code> <a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/qodana-yaml.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u914d\u7f6e\u6587\u4ef6<\/a>\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">version: \"1.0\"\n\nlinter: jetbrains\/qodana-dotnet:latest\n\ndotnet:\n  solution: MySolution.sln<\/pre>\n<p><em>\u6709\u5173 .NET \u76f8\u5173\u8bbe\u7f6e\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 <a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/qodana-dotnet.html\" target=\"_blank\" rel=\"noreferrer noopener\">Qodana for .NET<\/a> \u6587\u6863\u3002<\/em><\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u8c03\u7528&nbsp;<code>qodana scan --show-report<\/code>\uff0c\u6267\u884c\u672c\u5730 Qodana \u626b\u63cf\u3002&nbsp;\u626b\u63cf\u5b8c\u6210\u540e\uff0cQodana \u5c06\u5728\u6d4f\u89c8\u5668\u4e0a\u4ece <code>http:\/\/localhost:8080<\/code> \u6253\u5f00 HTML \u62a5\u544a\u3002<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-363310\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/scan-initial-1.png\" alt=\"\u521d\u59cb\u626b\u63cf\" width=\"1754\" height=\"1792\"><\/figure>\n<p>\u9664\u4e86\u901a\u7528 <a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/ui-overview.html\" target=\"_blank\" rel=\"noreferrer noopener\">User interface overview<\/a>\uff08\u7528\u6237\u754c\u9762\u6982\u89c8\uff09\uff0c\u5bf9\u4e8e.NET \u9879\u76ee\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4ece <strong>Tags<\/strong>\uff08\u6807\u7b7e\uff09\u4e0b\u62c9\u5217\u8868\u6309\u76ee\u6807\u6846\u67b6\u8fdb\u884c\u7b5b\u9009\u3002&nbsp;\u53e6\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4e0e\u65ed\u65e5\u56fe\u4ea4\u4e92\u6765\u7b5b\u9009\u7ed3\u679c\u3002<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-363321\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/sunburst-chart2.jpg\" alt=\"\u4ea4\u4e92\u5f0f\u65ed\u65e5\u56fe\" width=\"679\" height=\"576\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/sunburst-chart2.gif\"><\/figure>\n<p><em>\u8d85\u9177\uff01<\/em> &#x1f60e;<\/p>\n<p>\u627e\u5230\u8981\u8c03\u67e5\u7684\u95ee\u9898\u540e\uff0c\u60a8\u53ef\u4ee5\u5c06\u5176\u5c55\u5f00\uff0c\u663e\u793a\u4e00\u822c\u95ee\u9898\u6587\u672c\/\u7c7b\u522b\/\u7c7b\u578b\u4e4b\u5916\u7684\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002&nbsp;\u5728\u8be6\u7ec6\u4fe1\u606f\u7a97\u683c\u4e2d\uff0c\u60a8\u53ef\u4ee5\u67e5\u770b\u5b9e\u9645\u4ee3\u7801\u6bb5\u4ee5\u53ca\u6587\u4ef6\u8def\u5f84\u548c\u76ee\u6807\u6846\u67b6\u3002&nbsp;\u9700\u8981\u7279\u522b\u6ce8\u610f\u53ef\u4ee5\u76f4\u63a5\u5728 IDE \u4e2d\u6253\u5f00\u6587\u4ef6\u7684 <strong>Open file in Rider<\/strong>\uff08\u5728 Rider \u4e2d\u6253\u5f00\u6587\u4ef6\uff09\u6309\u94ae\uff0c\u4ee5\u53ca\u5305\u542b\u6211\u4eec\u7684 <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2023\/03\/20\/why-is-resharper-suggesting-this\/\"><em>Why is ReSharper suggesting this?<\/em><\/a> \u77e5\u8bc6\u5e93\u94fe\u63a5\u7684\u9875\u811a\u6ce8\u91ca\uff1a<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-363332\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/issue-details.png\" alt=\"\u95ee\u9898\u8be6\u7ec6\u4fe1\u606f\u89c6\u56fe\" width=\"1742\" height=\"816\"><\/figure>\n<h2 id=\"qodana-scans-in-cicd-environments\" class=\"wp-block-heading\">CI\/CD \u73af\u5883\u4e2d\u7684 Qodana \u626b\u63cf<\/h2>\n<p>Qodana \u96c6\u6210\u5230 CI\/CD \u73af\u5883\u540e\u5c06\u5145\u5206\u53d1\u6325\u6f5c\u529b\u3002&nbsp;\u6bcf\u4e2a\u6784\u5efa\u90fd\u5e94\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5206\u6790\u62a5\u544a\uff0c\u53ef\u4ee5\u4e0a\u4f20\u5230 <a href=\"https:\/\/qodana.cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\">Qodana Cloud<\/a>\uff0c\u4e5f\u53ef\u4ee5\u5728 Rider \u4e2d\u4e0b\u8f7d\u548c\u68c0\u67e5\u3002&nbsp;\u60a8\u8fd8\u53ef\u4ee5\u5728\u6784\u5efa\u7ba1\u9053\u4e2d\u5efa\u7acb<em>\u8d28\u91cf\u95e8<\/em>\uff0c\u91c7\u7528\u7c7b\u4f3c\u4e8e <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2016\/10\/04\/establishing-a-zero-warning-policy-with-resharpers-solution-wide-analysis\/\"><em>Establishing a zero-warning policy with ReSharper\u2019s solution-wide analysis<\/em><\/a> \u535a\u6587\u4e2d\u63cf\u8ff0\u7684\u65b9\u5f0f\u3002&nbsp;\u5728\u63d0\u4ea4\u6216\u62c9\u53d6\u8bf7\u6c42\u5f15\u5165\u4ee3\u7801\u95ee\u9898\u65f6\uff0cQodana \u4f1a\u901a\u8fc7\u6784\u5efa\u5931\u8d25\u53d1\u51fa\u901a\u77e5\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u4e09\u4e2a\u7b80\u5355\u7684\u6b65\u9aa4\u542f\u7528<strong>\u4ee3\u7801\u8d28\u91cf\u95e8<\/strong>\u3002&nbsp;\u5bf9\u4e8e\u975e\u65b0\u5efa\u9879\u76ee\uff0c\u60a8\u53ef\u80fd\u6700\u597d\u5c06\u6240\u6709\u73b0\u6709\u95ee\u9898\u79fb\u81f3<em>\u57fa\u7ebf<\/em>\uff08\u7c7b\u4f3c\u4e8e\u79ef\u538b\u5de5\u4f5c\uff09\uff0c\u51cf\u5c11\u969c\u788d\uff1a<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/baseline-download.png\" alt=\"\u57fa\u7ebf\u62a5\u544a\u4e0b\u8f7d\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/baseline-download.gif\"><\/figure>\n<p>\u5176\u6b21\uff0c\u60a8\u9700\u8981\u4f7f\u7528 <code>failThreshold<\/code> \u503c\u6269\u5c55 <code>qodana.yml<\/code> \u914d\u7f6e\u6587\u4ef6\u3002&nbsp;\u6b64\u5c5e\u6027\u6307\u793a\u4e0e\u57fa\u7ebf\u76f8\u6bd4\uff0c\u5728\u4e0d\u5bfc\u81f4\u6784\u5efa\u5931\u8d25\u7684\u60c5\u51b5\u4e0b\u53ef\u4ee5\u51fa\u73b0\u591a\u5c11\u4e2a\u65b0\u95ee\u9898\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">version: \"1.0\"\n\nlinter: jetbrains\/qodana-dotnet:latest\nfailThreshold: 0\n\ndotnet:\n  solution: MySolution.sln<\/pre>\n<p>\u7b2c\u4e09\uff0c\u60a8\u5fc5\u987b\u914d\u7f6e\u6784\u5efa\u7ba1\u9053\uff0c\u624d\u80fd\u5c06\u5f53\u524d\u4ee3\u7801\u95ee\u9898\u96c6\u4e0e<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/baseline.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u57fa\u7ebf<\/a>\u5bf9\u6bd4\u3002&nbsp;\u5411 Qodana \u626b\u63cf\u8c03\u7528\u4f20\u9012 <code>--baseline qodana.sarif.json<\/code> \u5373\u53ef\u3002&nbsp;\u67e5\u9605 Qodana \u6587\u6863\uff0c\u8fdb\u4e00\u6b65\u4e86\u89e3<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/quality-gate.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u5982\u4f55\u5728 CI\/CD \u73af\u5883\u4e2d\u542f\u7528\u8d28\u91cf\u95e8<\/a>\u3002<\/p>\n<p>\u5982\u679c\u60a8\u60f3\u5229\u7528 <a href=\"https:\/\/qodana.cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\">Qodana Cloud<\/a>\uff0c\u53ef\u4ee5\u5c06 <code>QODANA_TOKEN<\/code> \u6dfb\u52a0\u4e3a\u73af\u5883\u53d8\u91cf\uff0c\u4f7f Qodana \u6301\u7eed\u4e0a\u4f20\u62a5\u544a\uff0c\u8be6\u7ec6\u5c55\u793a\u5176\u5386\u53f2\u8fdb\u7a0b\u3002 \u53e6\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528 <code>qodana show<\/code> \u547d\u4ee4\u5728\u672c\u5730\u63d0\u4f9b\u4e0b\u8f7d\u7684\u62a5\u544a\u3002<\/p>\n<p>\u4e0b\u4e00\u6b21 Qodana \u626b\u63cf\u5e94\u5982\u4e0b\u6240\u793a\uff0c\u6240\u6709\u95ee\u9898\u5747\u5df2\u79fb\u81f3 <strong>Baseline<\/strong>\uff08\u57fa\u7ebf\uff09\u6807\u7b7e\u9875\uff1a<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364256\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/scan-clean.png\" alt=\"\u6e05\u7406\u626b\u63cf\" width=\"779\" height=\"464\"><\/figure>\n<p>\u63a5\u4e0b\u6765\u7684\u51e0\u8282\u5c06\u8bb2\u89e3 Qodana \u5982\u4f55\u4e0e\u5e02\u573a\u4e0a\u6700\u6d41\u884c\u7684 CI\/CD \u73af\u5883\u96c6\u6210\u3002&nbsp;\u6709\u5173\u8be6\u60c5\uff0c\u8bf7\u53c2\u9605 <a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/github.html\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub Actions<\/a>\u3001<a href=\"https:\/\/www.jetbrains.com.cn\/en-us\/help\/qodana\/qodana-azure-pipelines.html\" target=\"_blank\" rel=\"noreferrer noopener\">Azure Pipelines<\/a>\u3001<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/teamcity.html\" target=\"_blank\" rel=\"noreferrer noopener\">TeamCity<\/a>\u3001<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/gitlab.html\" target=\"_blank\" rel=\"noopener\">GitLab<\/a>\u3001<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/circleci.html\" target=\"_blank\" rel=\"noreferrer noopener\">CircleCI<\/a>\u3001<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/space-automation.html\" target=\"_blank\" rel=\"noreferrer noopener\">Space Automation<\/a> \u548c&nbsp;<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/jenkins.html\" target=\"_blank\" rel=\"noreferrer noopener\">Jenkins<\/a> \u4e0a\u7684\u6587\u6863\u3002<\/p>\n<h3 id=\"qodana-in-github-actions\" class=\"wp-block-heading\">GitHub Actions \u4e2d\u7684 Qodana<\/h3>\n<p>\u5728 GitHub Actions \u4e2d\uff0cQodana \u53ef\u4ee5\u5145\u5f53\u6784\u5efa\u7684\u6bcf\u4e2a\u63d0\u4ea4\u548c\u62c9\u53d6\u8bf7\u6c42\u7684<a href=\"https:\/\/docs.github.com\/en\/pull-requests\/collaborating-with-pull-requests\/collaborating-on-repositories-with-code-quality-features\/about-status-checks\" target=\"_blank\" rel=\"noreferrer noopener\">\u72b6\u6001\u68c0\u67e5<\/a>\uff1a<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364267\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/github-actions-checks.png\" alt=\"GitHub Actions \u68c0\u67e5\" width=\"608\" height=\"275\"><\/figure>\n<p>\u7279\u522b\u662f\u5bf9\u4e8e\u62c9\u53d6\u8bf7\u6c42\uff0cQodana \u5c06\u6dfb\u52a0\u4ee3\u7801\u6ce8\u89e3\uff0c\u5e2e\u52a9\u4ee3\u7801\u5ba1\u67e5\u8005\u548c\u63d0\u4ea4\u8005\u7acb\u5373\u53d1\u73b0\u95ee\u9898\uff1a<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364278\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/github-actions-annotations.png\" alt=\"GitHub \u4ee3\u7801\u6ce8\u89e3\" width=\"908\" height=\"493\"><\/figure>\n<h3 id=\"qodana-in-azure-pipelines\" class=\"wp-block-heading\">Azure Pipelines \u4e2d\u7684 Qodana<\/h3>\n<p>Qodana \u4ee5 <a href=\"https:\/\/sarifweb.azurewebsites.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">SARIF<\/a> \u6587\u4ef6\uff08\u884c\u4e1a\u6807\u51c6\uff09\u5f62\u5f0f\u751f\u6210\u62a5\u544a\uff0c\u53ef\u4ee5\u901a\u8fc7 <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=sariftools.scans\" target=\"_blank\" rel=\"noreferrer noopener\">SARIF SAST Scans Tab<\/a> \u5c06\u8fd9\u4e9b\u62a5\u544a\u96c6\u6210\u5230 Azure Pipelines \u4e2d\uff1a<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364289\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/azure-pipelines-report.png\" alt=\"Azure Pipelines SARIF Scans Tab\" width=\"2184\" height=\"1408\"><\/figure>\n<h3 id=\"qodana-in-teamcity\" class=\"wp-block-heading\">TeamCity \u4e2d\u7684 Qodana<\/h3>\n<p>\u901a\u8fc7\u6211\u4eec\u81ea\u5df1\u7684\u5f3a\u5927 CI\/CD \u5de5\u5177 TeamCity\uff0cQodana \u62a5\u544a\u4f5c\u4e3a\u5355\u72ec\u7684\u6807\u7b7e\u9875\u76f4\u63a5\u8fdb\u5165\u6784\u5efa\u8be6\u7ec6\u4fe1\u606f\u89c6\u56fe\u3002&nbsp;\u60a8\u8fd8\u53ef\u4ee5\u6bd4\u8f83\u4e0d\u540c\u6784\u5efa\u7684\u62a5\u544a\uff0c\u67e5\u770b\u53d8\u5316\uff1a<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364300\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/teamcity-report.png\" alt=\"TeamCity \u6784\u5efa\u6807\u7b7e\u9875\" width=\"2004\" height=\"878\"><\/figure>\n<p><em>\u4e13\u5bb6\u63d0\u793a\uff1a\u60a8\u53ef\u4ee5<a href=\"https:\/\/www.jetbrains.com.cn\/help\/teamcity\/including-third-party-reports-in-the-build-results.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u5c06\u81ea\u5df1\u7684\u6807\u7b7e\u9875\u6dfb\u52a0\u5230 TeamCity<\/a>\uff01<\/em><\/p>\n<p>\u53e6\u4e00\u4e2a\u5de7\u5999\u529f\u80fd\u662f\u60a8\u53ef\u4ee5\u5c06\u4ee3\u7801\u95ee\u9898\u89c6\u4e3a\u5931\u8d25\u7684\u6d4b\u8bd5\u3002&nbsp;\u8fd9\u8ba9\u60a8\u53ef\u4ee5\u4f7f\u7528\u73b0\u6709\u7684<a href=\"https:\/\/www.jetbrains.com.cn\/help\/teamcity\/investigating-and-muting-build-failures.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u8c03\u67e5\u548c\u5ffd\u7565\u6784\u5efa\u5931\u8d25<\/a>\u5b9e\u73b0\u66f4\u6709\u6548\u7684\u56e2\u961f\u5de5\u4f5c\u6d41\uff1a<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364311\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/teamcity-assign.png\" alt=\"TeamCity \u4ee3\u7801\u95ee\u9898\u8c03\u67e5\u6307\u6d3e\" width=\"2052\" height=\"1250\"><\/figure>\n<h2 id=\"qodana-reports-in-rider\" class=\"wp-block-heading\">Rider \u4e2d\u7684 Qodana \u62a5\u544a<\/h2>\n<p>\u5f53\u7136\uff0cQodana \u4e0e Rider \u548c\u5176\u4ed6 IntelliJ IDEA \u884d\u751f\u4ea7\u54c1\u5b8c\u5168\u96c6\u6210\u3002&nbsp;<a href=\"https:\/\/www.jetbrains.com.cn\/help\/rider\/Problems_Tool_Window.html\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Problems<\/strong>\uff08\u95ee\u9898\uff09\u5de5\u5177\u7a97\u53e3<\/a>\u4e2d\u7684\u4e13\u5c5e <strong>Qodana<\/strong> \u6807\u7b7e\u9875\u53ef\u4f9b\u6d4f\u89c8\u6240\u6709\u53d1\u73b0\u7684\u95ee\u9898\u3001\u5728\u5355\u72ec\u7684\u7a97\u683c\u4e2d\u9884\u89c8\uff0c\u4ee5\u53ca\u5c06\u5176\u4fee\u6b63\uff08\u6216\u8005<a href=\"https:\/\/www.jetbrains.com.cn\/help\/rider\/Code_Analysis__Configuring_Warnings.html#suppress\" target=\"_blank\" rel=\"noreferrer noopener\">\u7981\u6b62<\/a>\u6216<a href=\"https:\/\/www.jetbrains.com.cn\/help\/rider\/Code_Analysis__Configuring_Warnings.html#change_severity\" target=\"_blank\" rel=\"noreferrer noopener\">\u66f4\u6539\u5176\u4e25\u91cd\u6027<\/a>\uff09\uff1a<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364322\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/tool-window.png\" alt=\"Rider Qodana \u5de5\u5177\u7a97\u53e3\" width=\"2192\" height=\"976\"><\/figure>\n<p><em>\u6211\u4eec\u8ba1\u5212\u5411\u5de5\u5177\u7a97\u53e3\u6dfb\u52a0\u66f4\u591a\u7b5b\u9009\u548c\u5206\u7ec4\u529f\u80fd\uff0c\u5305\u62ec\u4ee5\u76ee\u6807\u6846\u67b6\u4e3a\u6761\u4ef6\u3002<\/em><\/p>\n<p>\u6839\u636e\u60a8\u7684\u504f\u597d\uff0cQodana \u62a5\u544a\u53ef\u4ee5\u81ea\u52a8\u4ece Qodana Cloud \u62c9\u53d6\uff0c\u4e5f\u53ef\u4ee5\u4ece\u62a5\u544a\u6587\u4ef6\u4e2d\u624b\u52a8\u52a0\u8f7d\u3002<\/p>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f Qodana Cloud\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece\u8bbe\u7f6e\u5bf9\u8bdd\u6846<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/qodana-ide-plugin.html#Log+in+to+Qodana+Cloud\" target=\"_blank\" rel=\"noreferrer noopener\">\u767b\u5f55<\/a>\u3002&nbsp;\u767b\u5f55\u540e\uff0cRider \u5141\u8bb8\u60a8\u5c06\u5f53\u524d\u9879\u76ee\u4e0e Qodana Cloud \u4e2d\u7684\u9879\u76ee\u5173\u8054\uff1a<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364333\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/linking-project2.png\" alt=\"Rider Qodana \u9879\u76ee\u94fe\u63a5\u901a\u77e5\" width=\"432\" height=\"145\"><\/figure>\n<p>\u5982\u679c\u60a8\u6ca1\u6709 Qodana Cloud \u5e10\u6237\u6216\u8005\u66f4\u559c\u6b22\u624b\u52a8\u52a0\u8f7d\u62a5\u544a\uff0c\u53ef\u4ee5\u4f7f\u7528 <strong>Open Qodana Analysis Report\u2026<\/strong>\uff08\u6253\u5f00 Qodana \u5206\u6790\u62a5\u544a\u2026\uff09\u64cd\u4f5c\uff1a<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364355\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/load-report.png\" alt=\"Open Qodana Analysis Report\uff08\u6253\u5f00 Qodana \u5206\u6790\u62a5\u544a\uff09\u64cd\u4f5c\" width=\"728\" height=\"289\"><\/figure>\n<h2 id=\"future-work\" class=\"wp-block-heading\">\u672a\u6765\u8ba1\u5212<\/h2>\n<p>Qodana \u53d1\u5c55\u8fc5\u901f\uff0c\u6700\u8fd1\u8fc8\u51fa\u4e86\u8fdb\u5165 .NET \u751f\u6001\u7cfb\u7edf\u7684\u7b2c\u4e00\u6b65\u3002&nbsp;\u7531\u4e8e\u5206\u6790\u57fa\u4e8e\u5df2\u7ecf\u5b58\u5728\u591a\u5e74\u7684\u7ec4\u4ef6 (<em>InspectCode<\/em>)\uff0c\u534f\u540c\u6548\u5e94\u975e\u5e38\u663e\u8457\u3002&nbsp;\u63a5\u4e0b\u6765\uff0cQodana \u56e2\u961f\u8fd8\u6709\u66f4\u591a\u96c6\u6210\u8ba1\u5212\uff01<\/p>\n<p>\u4fdd\u6301\u51b7\u9759\uff0c\u6309 <kbd>Alt-Enter<\/kbd>\uff01&nbsp;\u5982\u679c CI \u53ef\u4ee5\u4e3a\u60a8\u81ea\u52a8\u5e94\u7528\u4ee3\u7801\u95ee\u9898\u548c\u6837\u5f0f\u8fdd\u89c4\u7684\u5feb\u901f\u4fee\u590d\uff0c\u90a3\u600e\u4e48\u6837\uff1f&nbsp;\u867d\u7136\u8fd9\u4e2a\u76ee\u6807\u5fc5\u7136\u9700\u8981\u66f4\u591a\u65f6\u95f4\uff0c\u4f46\u5f00\u53d1\u8005\u4e00\u5b9a\u4f1a\u559c\u6b22\u82b1\u66f4\u5c11\u65f6\u95f4\u8f93\u5165\u6837\u677f\u4ee3\u7801\uff0c\u5c06\u66f4\u591a\u7cbe\u529b\u653e\u5728\u9879\u76ee\u7684\u5546\u4e1a\u4ef7\u503c\u4e0a\u3002<\/p>\n<p>\u76ee\u524d\u6b63\u5728\u79ef\u6781\u5f00\u53d1\u7684\u4e00\u4e2a\u529f\u80fd\u662f<a href=\"https:\/\/www.jetbrains.com.cn\/help\/qodana\/license-audit.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u8bb8\u53ef\u8bc1\u5ba1\u6838<\/a>\u3002&nbsp;\u8fd9\u79cd\u626b\u63cf\u53ef\u4ee5\u5e2e\u52a9\u60a8\u9a8c\u8bc1\u9879\u76ee\u8bb8\u53ef\u8bc1\u662f\u5426\u7b26\u5408\u4f9d\u8d56\u9879\uff08\u4f8b\u5982 NuGet \u8f6f\u4ef6\u5305\uff09\u53ca\u5176\u6240\u6709\u4f20\u9012\u4f9d\u8d56\u9879\u7684\u8bb8\u53ef\u8bc1\u3002<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-364366\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/06\/license-audit.png\" alt=\"\u8bb8\u53ef\u8bc1\u5ba1\u6838\" width=\"787\" height=\"395\"><\/figure>\n<h2 class=\"wp-block-heading\">\u7ed3\u8bba<\/h2>\n<p>Qodana \u662f\u5728\u4ee3\u7801\u5e93\u4e2d\u534f\u4f5c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u7684\u7edd\u4f73\u9014\u5f84\u3002 \u5b83\u4e0e\u6240\u6709 JetBrains IDE \u4ee5\u53ca\u60a8\u7684\u9996\u9009 CI\/CD \u73af\u5883\u65e0\u7f1d\u96c6\u6210\u3002<\/p>\n<p><strong>\u5b89\u88c5 <a href=\"https:\/\/github.com\/JetBrains\/qodana-cli\" target=\"_blank\" rel=\"noreferrer noopener\">Qodana CLI<\/a><\/strong> \u5e76\u5728\u89e3\u51b3\u65b9\u6848\u4e2d\u8bd5\u7528\uff0c\u6216\u8005<strong>\u6ce8\u518c <a href=\"https:\/\/qodana.cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\">Qodana Cloud<\/a><\/strong>\uff0c\u8f7b\u677e\u6301\u7eed\u8ddf\u8e2a\u4ee3\u7801\u8d28\u91cf\u8fdb\u5ea6\u3002<\/p>\n<p>\u611f\u8c22\u9605\u8bfb\uff0c\u5982\u679c\u60a8\u6709\u4efb\u4f55\u610f\u89c1\u6216\u95ee\u9898\uff0c\u8bf7\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u3002<\/p>\n<p><em><sub>\u56fe\u7247\u6765\u6e90\uff1a<a href=\"https:\/\/unsplash.com\/photos\/AEE4G-6h858\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Jesse Gardner<\/a><\/sub><\/em><\/p>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u672c\u535a\u6587\u82f1\u6587\u539f\u4f5c\u8005\uff1a<\/p>\n\n\n    <div class=\"about-author \">\n        <div class=\"about-author__box\">\n            <div class=\"row\">\n                <div class=\"about-author__box-img\">\n                    <img decoding=\"async\" src=\"https:\/\/secure.gravatar.com\/avatar\/?s=200&#038;r=g\" width=\"200\" height=\"200\" alt=\"\" loading=\"lazy\"  class=\"avatar avatar-200 wp-user-avatar wp-user-avatar-200 photo avatar-default\">\n                <\/div>\n                <div class=\"about-author__box-text\">\n                                                        <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n","protected":false},"author":1297,"featured_media":364212,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992,1401],"tags":[211,228,164,6359,2615],"cross-post-tag":[6687],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/372370"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/1297"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=372370"}],"version-history":[{"count":4,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/372370\/revisions"}],"predecessor-version":[{"id":373238,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/372370\/revisions\/373238"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/364212"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=372370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=372370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=372370"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=372370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}