自动修复Sonar发现的问题 [英] Automate fixes for issues found by Sonar

查看:340
本文介绍了自动修复Sonar发现的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力修复声纳在一个非常古老的Java项目(大约8岁)上捕获的问题。
这是一个庞大的项目,有很多错误的代码被声纳捕获。
虽然它们是非常简单的修复,但有很多。
有没有办法自动修复一系列类似的问题?
就像我有大约1200个语句应该在单独的行上的情况一样,手动完成需要很长时间。
我可以以某种方式自动修复这些修补程序吗?

I am working on fixing issues caught by sonar on a very old Java project(8 years old approximately ). It is a huge project with a lot of faulty code that is caught by sonar. Although they are very trivial fixes but there are a number of them. Is there a way to automatically fix a series of similar issues ? Like i have around 1200 cases of "statements should be on separate lines" , to do it manually would take ages. Can i automate these fixes somehow ?

推荐答案

我认为我不希望Sonar改变来源。这是一个代码分析器

I don't think I would want Sonar to change source. It's a code analyzer.

您可以将IDE配置为在保存时格式化,并对所有受影响的源文件执行初始格式,以便将声明放在不同的行上。

You could configure your IDE to format on save and do an initial format of all afflicted source files, so that it puts the satements on separate lines.

此外,您可能想要查看问题的重要性并更改/编辑质量配置文件。

Also, you might want to review the importance of the problem and change/edit the Quality Profile.

这篇关于自动修复Sonar发现的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆