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>
21Install CodeChecker as described here: <a href="https://github.com/Ericsson/codechecker/#Install-guide"> CodeChecker Install Guide.</a>
22</p>
23
24<p>
25Create 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.
26If 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">
28make clean
29CodeChecker log -b "make" -o compile_commands.json
30</pre>
31</p>
32
33<p>
34Analyze your project.
35<pre class="code_example">
36CodeChecker analyze compile_commands.json -o ./reports
37</pre>
38</p>
39
40<p>
41View the analysis results.
42Print the detailed results in the command line:
43<pre class="code_example">
44CodeChecker parse --print-steps ./reports
45</pre>
46Or view the detailed results in a browser:
47<pre class="code_example">
48CodeChecker parse ./reports -e html -o ./reports_html
49firefox ./reports_html/index.html
50</pre>
51</p>
52
53<p>
54Optional: store the analysis results in a DB.
55<pre class="code_example">
56mkdir ./ws
57CodeChecker server -w ./ws -v 8555 &
58CodeChecker store ./reports --name my-project --url http://localhost:8555/Default
59</pre>
60</p>
61
62<p>
63Optional: manage (categorize, suppress) the results in your web browser:
64<pre class="code_example">
65firefox http://localhost:8555/Default
66</pre>
67</p>
68
69<h2>Detailed Usage</h2>
70
71<p>
72For 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>
74