Java 清除 Intellij 中的代码覆盖率信息

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31712361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 11:28:28  来源:igfitidea点击:

Clear code coverage information in Intellij

javaintellij-ideacode-coverage

提问by devoured elysium

I have configured Intellij to paint the background of any line that has been executed at runtime to the green color, when running in Coverage mode.

在 Coverage 模式下运行时,我已将 Intellij 配置为将在运行时执行的任何行的背景绘制为绿色。

At time I would like to just make all the files in the project revert back to their old and typical background colors, i.e, to remove all the coverage information.

有时我只想让项目中的所有文件恢复到它们旧的和典型的背景颜色,即删除所有覆盖信息。

Is that possible? How?

那可能吗?如何?

Thanks

谢谢

回答by Maciej Dobrowolski

just close the coverage window with "x" button:

只需使用“x”按钮关闭覆盖窗口:

closing window

关闭窗口

update: for the recent IntelliJ IDEA 2018.2.x, you can hide coverage by clicking left-hand side coverage bar (the colored one, close to line numbers) and then Hide coveragelink:

更新:对于最近的 IntelliJ IDEA 2018.2.x,您可以通过单击左侧的覆盖栏(彩色的,靠近行号)然后Hide coverage链接来隐藏覆盖范围:

closing window in IDEA 2018.2.x

在 IDEA 2018.2.x 中关闭窗口

回答by Kunal

Go to View > Tool Windows > Coverage

转到查看 > 工具窗口 > 覆盖范围

Click on the small icon button Delete Coverage Database

单击小图标按钮删除覆盖数据库

Clean coverage database

清洁覆盖数据库

回答by Md Ayub Ali Sarker

To view/close code coverage results => Run the desired class with coverage, select suite to show, and open class in the editor. => On the main menu, choose Analyze | Show/remove Code Coverage Data.

查看/关闭代码覆盖率结果 => 运行具有覆盖率的所需类,选择要显示的套件,然后在编辑器中打开类。=> 在主菜单上,选择分析 | 显示/删除代码覆盖率数据。

回答by Abhilash Reddy

enter image description here

在此处输入图片说明

You can just Right Click on your Project,

您只需右键单击您的项目,

Goto Analyze -> Hide Coverage data

Analyze -> Hide Coverage data

回答by HouFeng

  1. double shift;
  2. input hide;
  3. choose Hide Coverage data;
  4. Over.
  1. 班制
  2. 输入隐藏;
  3. 选择隐藏覆盖数据
  4. 超过。