codechecker.html
2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CodeChecker: running the analyzer from the command line</title>
<link type="text/css" rel="stylesheet" href="content.css">
<link type="text/css" rel="stylesheet" href="menu.css">
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body>
<div id="page">
<!--#include virtual="menu.html.incl"-->
<div id="content">
<h1>CodeChecker: running the analyzer from the command line</h1>
<h2>Basic Usage</h2>
<p>
Install CodeChecker as described here: <a href="https://github.com/Ericsson/codechecker/#Install-guide"> CodeChecker Install Guide.</a>
</p>
<p>
Create a compilation database. If you use cmake then pass the <tt>-DCMAKE_EXPORT_COMPILE_COMMANDS=1</tt> parameter to cmake. Cmake will create a <tt>compile_commands.json</tt> file.
If you have a Makefile based or similar build system then you can log the build commands with the help of CodeChecker:
<pre class="code_example">
make clean
CodeChecker log -b "make" -o compile_commands.json
</pre>
</p>
<p>
Analyze your project.
<pre class="code_example">
CodeChecker analyze compile_commands.json -o ./reports
</pre>
</p>
<p>
View the analysis results.
Print the detailed results in the command line:
<pre class="code_example">
CodeChecker parse --print-steps ./reports
</pre>
Or view the detailed results in a browser:
<pre class="code_example">
CodeChecker parse ./reports -e html -o ./reports_html
firefox ./reports_html/index.html
</pre>
</p>
<p>
Optional: store the analysis results in a DB.
<pre class="code_example">
mkdir ./ws
CodeChecker server -w ./ws -v 8555 &
CodeChecker store ./reports --name my-project --url http://localhost:8555/Default
</pre>
</p>
<p>
Optional: manage (categorize, suppress) the results in your web browser:
<pre class="code_example">
firefox http://localhost:8555/Default
</pre>
</p>
<h2>Detailed Usage</h2>
<p>
For extended documentation please refer to the <a href="https://github.com/Ericsson/codechecker/blob/master/docs/usage.md">official site of CodeChecker</a>!
</p>