pvs-stdio ue4_适用于Visual C#的PVS-Studio静态分析器入门

pvs-stdio ue4

Picture 4

To be able to work with Visual C#, the analyzer integrates into Visual Studio as a plugin. This allows you to use Visual Studio's interface to customize the analyzer's settings, quickly and easily check individual files, projects, and solutions, and to handle PVS-Studio reports as well.

为了能够使用Visual C#,分析器作为插件集成到Visual Studio中。 这使您可以使用Visual Studio的界面自定义分析仪的设置,快速轻松地检查单个文件,项目和解决方案,以及处理PVS-Studio报告。

The hardware requirements for this mode are the same as those of the Visual Studio IDE that you work in.

此模式的硬件要求与您使用的Visual Studio IDE相同。

The PVS-Studio installer can be downloaded here. The download page also offers a number of different use modes, including trial mode. See the purchase guide for licensing details.

可以在此处下载PVS-Studio安装程序。 下载页面还提供了许多不同的使用模式,包括试用模式。 有关许可的详细信息,请参阅购买指南

To install the plugin, run the PVS-Studio installer and tick the desired Visual Studio versions:

要安装插件,请运行PVS-Studio安装程序并勾选所需的Visual Studio版本:

Picture 1

The analyzer is ready to run immediately after installation.

安装后,分析仪即可立即运行。

Run Visual Studio, open your project, click the «Extensions» main menu and then the «PVS-Studio» submenu (in Visual Studio versions earlier than 2019, the «PVS-Studio» menu is placed right on the menu bar).

运行Visual Studio,打开您的项目,单击“扩展”主菜单,然后单击“ PVS-Studio”子菜单(在2019年之前的Visual Studio版本中,«PVS-Studio»菜单位于菜单栏上)。

A drop-down menu will appear with all the plugin's features available for use.

将出现一个下拉菜单,其中包含所有可用的插件功能。

To check the entire solution, click the «Check» submenu and then «Solution». The analyzer will start preparing for the check:

要检查整个解决方案,请单击“检查”子菜单,然后单击“解决方案”。 分析仪将开始准备检查:

Picture 2

After that, the analysis process starts:

之后,分析过程开始:

Picture 3

Even before the check is over, warnings will start to appear in the report (PVS-Studio window) as the analyzer runs on, so you can start examining the respective code fragments right away. Double-clicking on a warning will take you to the corresponding code snippet in the Visual Studio editor, with suspicious lines highlighted:

甚至在检查结束之前,分析仪运行时,警告(警告)将开始出现在报告(PVS-Studio窗口)中,因此您可以立即开始检查相应的代码片段。 双击警告将带您进入Visual Studio编辑器中的相应代码段,并突出显示可疑行:

Picture 7

Clicking a diagnostic number link (for example, V3095) in the PVS-Studio window will take you to the documentation on that diagnostic, where you can learn the details about it and ways to fix bugs it detects.

单击PVS-Studio窗口中的诊断号链接(例如V3095 )将带您到该诊断的文档,您可以在其中了解有关该诊断的详细信息以及修复检测到的错误的方法。

You can save analysis results to study them later. To do that, open the «Extensions» menu, then «PVS-Studio» -> «Open/Save» -> «Save Analysis Report» (in Visual Studio versions earlier than 2019, the «PVS-Studio» menu is placed right on the menu bar).

您可以保存分析结果以供以后研究。 为此,请打开“扩展”菜单,然后打开“ PVS-Studio”->“打开/保存”->“保存分析报告”(在2019年之前的Visual Studio版本中,将“ PVS-Studio»菜单放在右边在菜单栏上)。

We keep working to make our C# analyzer better. As one of the latest innovations, we added support of Nullable Reference types for the C# 8.0 standard.

我们一直在努力使我们的C#分析器更好。 作为最新的创新之一,我们为C#8.0标准添加了对Nullable Reference类型的支持

To learn more about the features of the PVS-Studio Windows plugin, see the article "Getting acquainted with the PVS-Studio static code analyzer on Windows".

要了解有关PVS-Studio Windows插件功能的更多信息,请参阅文章“ 在Windows上熟悉PVS-Studio静态代码分析器 ”。

You can also use command-line utilities to check Visual C# projects and solutions. This use mode is extensively covered in the article "Analyzing Visual Studio projects from the command line".

您还可以使用命令行实用程序来检查Visual C#项目和解决方案。 在“ 从命令行分析Visual Studio项目文中广泛讨论了这种使用模式。

Finally, the article "PVS-Studio and Continuous Integration" explains how PVS-Studio can be used in expert inspection.

最后,文章“ PVS-Studio和持续集成 ”解释了如何在专家检查中使用PVS-Studio。

Try PVS-Studio — get rid of bugs!

尝试PVS-Studio-摆脱错误!

翻译自: https://habr.com/en/company/pvs-studio/blog/460935/

pvs-stdio ue4

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值