简体   繁体   English

Klocwork - 如何扫描跨平台项目?

[英]Klocwork - how to scan cross-platform projects?

We have a project with a single code base which we build both on Windows and Linux.我们有一个包含单一代码库的项目,我们在 Windows 和 Linux 上都构建了该项目。 And we want to run Klocwork code analysis on both Windows and Linux.我们希望在 Windows 和 Linux 上运行 Klocwork 代码分析。 Currently our approach is:目前我们的做法是:

  • We have set up one KW project in the web UI我们已经在 Web UI 中设置了一个 KW 项目
  • Inject and build on Linux, push the results to the server, save the report在 Linux 上注入并构建,将结果推送到服务器,保存报告
  • Inject and build on Windows, push the results to the server, save the report在 Windows 上注入和构建,将结果推送到服务器,保存报告

It somehow works, but the problem is that latter scan effectively overwrites results of the first one.它以某种方式起作用,但问题是后一个扫描有效地覆盖了第一个扫描的结果。 If we save report directly after push, then we can still have a saved copy, but if developers want to triage/analyze the hit which is present only in the first build (ie some Linux-specific code), then it's almost impossible because KW has already marked this hit as "obsolete" (because it was not present in Windows scan)如果我们在 push 后直接保存报告,那么我们仍然可以有一个保存的副本,但是如果开发人员想要分类/分析只出现在第一个构建中的命中(即一些 Linux 特定的代码),那么这几乎是不可能的,因为 KW已经将此命中标记为“过时”(因为它不存在于 Windows 扫描中)

Having two projects is not really an option, because 90% of the code is shared and it will cause huge overhead of developers to triage the same hits twice.拥有两个项目并不是一个真正的选择,因为 90% 的代码是共享的,这将导致开发人员对相同的点击进行两次分类的巨大开销。

There are multiple options to achieve your goal.有多种选择可以实现您的目标。

Option 1 : There is a tab under projects called Builds.选项 1 :在名为 Builds 的项目下有一个选项卡。 That can give you the build chain report.这可以为您提供构建链报告。 here you can see the reports of previous builds.在这里您可以看到以前构建的报告。

Option 2 : Are you using Klocwork desktop tools (Plugins/kwcheck)?选项 2 :您是否使用 Klocwork 桌面工具(插件/kwcheck)? If yes, developer will be notified automatically about the new defects/issues that he has produced at his machine.如果是,开发人员将自动收到有关他在其机器上产生的新缺陷/问题的通知。 So there may be no question of reviewing Klocwork portal by a developer just to see what are all the issues he has created.因此,开发人员查看 Klocwork 门户可能只是为了查看他创建的所有问题是没有问题的。

Option 3 : I see you have mentioned 90% of the code has been shared.选项 3 :我看到您提到了 90% 的代码已共享。 Is that meant, your project needs windows dlls and Linux libraries together to build your project?.这是否意味着,您的项目需要 Windows dll 和 Linux 库一起来构建您的项目?。

If the Answer is YES, please do let me know.如果答案是肯定的,请告诉我。 i will think about some possible workarounds.我会考虑一些可能的解决方法。

If the Answer is NO, then creating kwtables is one time job and from second time onwards Klocwork can perform incremental analysis ( kwbuildproject ....... --incremental )如果答案是否定的,那么创建 kwtables 是一次工作,从第二次开始 Klocwork 可以执行增量分析( kwbuildproject ....... --incremental

Option 4 : Creating multiple project is not a bad option.选项 4 :创建多个项目是一个不错的选择。 Existing project settings can be replicated and the issue status can be sync.可以复制现有项目设置,并且可以同步问题状态。 When you push the results to Klocwork server, the results will be pushed from Build Machine to Klocwork web/database server and it creates /projects_root/My_Project/builds/My_Build_Name/ directory.当您将结果推送到 Klocwork 服务器时,结果将从 Build Machine 推送到 Klocwork web/database 服务器并创建/projects_root/My_Project/builds/My_Build_Name/目录。 So, maintaining two Klocwork projects wont make much of a difference.因此,维护两个 Klocwork 项目不会有太大区别。

Option 5 : Schedule a call with Klocwork support team.选项 5 :安排与 Klocwork 支持团队的通话。 They will be happy to assist you with the best possible way.他们将很乐意以最佳方式为您提供帮助。

I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM