Coverity 5.5开始就需要安装两套工具

Coverity® 5.5.3 Integrity Manager  --- GUI

Coverity® 5.5.3 Static Analysis   ---  CLI 

 

Coverity® 5.5.3 Integrity Manager的安装

点击安装文件后,即可。 注意以下标红位置。

Where should Coverity Integrity Manager be installed?

[/home/fesu/coverity-integrity-manager] 这里可以修改cim安装路径

The directory:

/home/fesu/coverity-integrity-manager

already exists. Would you like to install to that directory anyway?

Yes [1], No [2]

1

How should Coverity Integrity Manager store information?

Coverity Integrity Manager requires a database to store information in. This

installer includes the PostgreSQL database software, which it can set up and

manage automatically. This is recommended for most cases. Alternatively,

organizations with existing database infrastructure and adminstrative

expertise can configure Integrity Manager to connect to an external

PostgreSQL (8.1 or higher) server.

Select one:

Use included PostgreSQL database (Recommended) [1, Enter], Connect to external PostgreSQL server [2]

Where should the database reside?

Specify a location for the database files, and an internal network port for

the database. The location should be on a local volume that has at least 2GB

of free space.

Location of database files:

[/home/fesu/coverity-integrity-manager/database]

Database port:

[5432]

Choose a level of database performance.

The default PostgreSQL configuration settings are designed to ensure that

the database will work on almost any computer. Although the database will

successfully start with default settings, it will not perform well. If

performance is important to you, you might choose the production database

configuration. However, if your system lacks sufficient resources, the

database will fail to start.

Tip: If you are not sure what setting to use, choose Small computer. After

the installation completes, see the System Administration Guide section

about tuning the PostgreSQL database.

Configure the database for a:

Small computer (not optimal performance) [1, Enter], Production system (might not start on a small computer) [2]

Server configuration

The installer creates an administrative account for Coverity Integrity

Manager. Administrators can use this account to log in with a web browser

and configure users, create projects, and manage other administrative

settings.

Please choose an administrator password.

Account name: admin 这里设置GUI admin的密码。

Password:

Confirm password:

Choose port numbers.

Users connect to the HTTP port to access the Integrity Manager via web

browsers and Web Services clients.

HTTP port number: 这里是访问GUI界面的端口

[8080]

9601

If you choose to provide HTTPS (Secure HTTP) service, HTTP requests are

rejected.

With HTTPS service, you will need to get a server certificate from a

certificate authority and install it. Please see the Administration and

Configuration Guide for more detailed instructions.

Provide HTTPS service?

Yes [y], No [n, Enter]

What ports should Integrity Manager use?

Build and analysis machines use the commit port to publish analysis results

to Integrity Manager.

Commit port: ß这里是cov-commit-defects执行是指定的commit端口

[9090]

9611

The control port is used for internal server communication. Use the default

value unless that port is unavailable.

Control port:

[8005]

Extracting files...

Downloading ...

Extracting files...

Configuring database

Creating database cluster

Adjusting file permissions

Starting database

Creating database schema

Stopping database

Database configured.

Starting Coverity Integrity Manager

Loading configuration

Starting controller

Starting database

Starting application

Done

Coverity Integrity Manager is installed and running at

http://xxxx.cn.alcatel-lucent.com:9601/这个是GUI的访问地址

Log in as "admin".

Finishing installation...

 

Coverity® 5.5.3 Static Analysi

这套工具公司是安装好的,我们需要了解它的常用命令及其工作方式:

 

 

常见问题:

cov-analyze报错:Looking for translation units Error: no matching translation units.**

或者cov-analyze的结果是0。

Analysis summary report:
------------------------
Files analyzed                 : 0
New defects found              : 0


解决方法:
1.检查一下cov-configure的选项

  cov-configure --config $CONFIG_FILE --compiler gcc --comptype gcc

   注意:在写--compiler的参数时,如果带/usr/bin/gcc,最后会解析不出结果,所以不要用绝对路径。

   有时候项目中会用到交叉编译的xxx-linux-gnu-gcc,它的路径是定义在makefile中,导致在命令行中运行coverity时候,环境变量中找不到xxx-linux-gnu-gcc。

   我通常是写一个shell脚本

  export PATH=/xxx-linux-gnu-gcc-path/:$PATH
  $COV_BIN/cov-configure --config $CONFIG_FILE --compiler xxx-linux-gnu-gcc --comptype gcc

2. 检查cov-analyze的选项

   cov-analyze的选项,发现要带上--all 才会有结果,如果再把--aggressiveness-level 调到high,这样检查的结果更多
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐