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