What tools exist for comparing C++ code to coding

2019-01-23 18:24发布

There exist tools for comparing code against a custom specified set of coding guidelines/standards for a variety of languages (rather than pure static analysis for common defects). Examples include FxCop for .Net code and CheckStyle for Java, but I was wondering what examples people know of in the C++ world.

An existing question was asked regarding free tools which provided examples like Vera but I was also wondering about commercial tools that may be available.

6条回答
Juvenile、少年°
2楼-- · 2019-01-23 18:35

I was also wondering about commercial tools that may be available.

Visual Studio Team System Edition 2005/2008 does have some such stuff. They also have a facility to enforce a set of rules on a whole team. Check it out.

查看更多
一夜七次
3楼-- · 2019-01-23 18:44

The full list that I managed to generate:

The last two provide some functionality but not particularly customisable ones:

查看更多
何必那么认真
4楼-- · 2019-01-23 18:48

astyle is a common Unix tool that reformats source to a specified style. It supports most C-like languages. I know of no similar commercial tools.

查看更多
劫难
5楼-- · 2019-01-23 18:49

DISCLAIMER: Working on this tool is my day job.

I'm obviously biased, but one of the main features of QA C++ is Coding Standard enforcement. For example we do JSF++ and MISRA C++ enforcement. You can read more about this here.

查看更多
▲ chillily
6楼-- · 2019-01-23 18:52

A tool used by us was CodeWizard from Parasoft. But I think the new version is called "Parasoft C++ Test". From the homepage:

  • Static analysis of code for compliance with user-selected coding standards
  • Graphical RuleWizard editor for creating custom coding rules
  • Static code path simulation for identifying potential runtime errors
  • Automated code review with a graphical interface and progress tracking
  • Automated generation and execution of unit and component-level tests
  • Flexible stub framework
  • Full support for regression testing
  • Code coverage analysis with code highlighting
  • Runtime memory error checking during unit test execution
  • Full team deployment infrastructure for desktop and command line usage
查看更多
We Are One
7楼-- · 2019-01-23 18:53

I do not know whether you looking for a tool with built-in rules or want to validate against your custom rules. If it is the second, you may find it useful to implement searches for undesirable patterns based on regexp. Depending on your needs, Metrix++ http://metrixplusplus.sourceforge.net/ may offer helpful framework.

查看更多
登录 后发表回答