|
2 | 2 |
|
3 | 3 | [](https://travis-ci.org/Ericsson/CodeCheckerEclipsePlugin)
|
4 | 4 |
|
5 |
| -This is a C/C++ code analysis plugin for Eclipse that shows bugs detected by the [Clang Static Analyzer](http://clang-analyzer.llvm.org/) and [Clang Tidy](http://clang.llvm.org/extra/clang-tidy/) analyzers, using [CodeChecker](https://github.com/Ericsson/codechecker) as a backend, |
| 5 | +This is a C/C++ code analysis plugin for Eclipse that shows bugs detected by the [Clang Static Analyzer](http://clang-analyzer.llvm.org/) and [Clang Tidy](http://clang.llvm.org/extra/clang-tidy/) analyzers, using [CodeChecker](https://github.com/Ericsson/codechecker) as a backend to run the analyzers. |
6 | 6 |
|
7 |
| -## Requirements |
| 7 | +# Requirements |
8 | 8 |
|
9 |
| -* Linux operating system |
10 |
| -* Recent [CodeChecker](https://github.com/Ericsson/codechecker) |
11 |
| -* [Eclipse](www.eclipse.org): the plugin is currently tested with Eclipse Neon, but any recent Eclipse version should work |
12 |
| -* Eclipse CDT |
| 9 | +* Linux operating system (Tested on Ubuntu 16.04) |
| 10 | +* Recent [CodeChecker](https://github.com/Ericsson/codechecker) (v6.8.0 or newer) |
| 11 | +* [Eclipse](https://www.eclipse.org): the plugin is currently tested with Eclipse Neon, but any recent Eclipse version should work |
| 12 | +* [Eclipse CDT](https://www.eclipse.org/cdt/) (C/C++ Development Tooling) |
13 | 13 | * Java 1.7
|
14 | 14 |
|
15 |
| -## Build and install CodeChecker Eclipse Plugin |
16 |
| -### Build |
17 |
| -run `mvn package` in the project's directory in: |
| 15 | +# Build and install CodeChecker Eclipse Plugin |
| 16 | +## Build |
18 | 17 |
|
19 |
| -`./eclipse-plugin/` |
| 18 | +```sh |
| 19 | +cd ./eclipse-plugin |
| 20 | +mvn package # build the plugin and run the tests |
| 21 | +``` |
20 | 22 |
|
21 |
| -### Install |
22 |
| -* Copy the `cc.codechecker.eclipse.plugin-0.0.6-SNAPSHOT.jar`: |
23 |
| - * From: ./eclipse-plugin/eclipse/cc.codechecker.eclipse.plugin/target/ |
24 |
| - * To: the dropins directory of Eclipse |
25 |
| - |
26 |
| -## How to use |
27 |
| -Make sure that before staring Eclipse: |
| 23 | +## Install |
| 24 | +Copy the `cc.codechecker.eclipse.plugin-0.0.6-SNAPSHOT.jar`: |
| 25 | +* From: `./eclipse-plugin/eclipse/cc.codechecker.eclipse.plugin/target/` |
| 26 | +* To: the `dropins` directory of Eclipse |
28 | 27 |
|
| 28 | +# How to use |
| 29 | +Make sure that before starting Eclipse: |
29 | 30 | * CodeChecker/bin directory is included in PATH (e.g.: `export PATH="/home/<username>/CodeChecker/bin/:$PATH"`)
|
30 | 31 | * Python virtualenv with CodeChecker dependencies is sourced (e.g.: `source /home/<username>/venv/bin/activate`)
|
31 | 32 |
|
32 |
| -__Currently the plugin is only usable with a CDT project.__ |
| 33 | +__Currently the plugin is only usable with a CDT project!__ |
33 | 34 |
|
34 |
| -#### 1. Setup Perspective |
| 35 | +## 1. Setup Perspective |
35 | 36 | In Eclipse, select Window, Perspectives, and activate the CodeChecker perspective.
|
36 | 37 | Alternatively, you can manually add the two windows under the CodeChecker category into any perspective, using the Window - Views menu.
|
37 | 38 |
|
38 | 39 | 
|
39 | 40 |
|
40 |
| -#### 2. Setup Nature |
| 41 | +## 2. Setup Nature |
41 | 42 | The plugin is activated on a per project basis, first you have to add the __CodeChecker Nature__ to a CDT project using the projects context menu in the project explorer with `Add CodeChecker Nature` command.
|
42 | 43 |
|
43 | 44 | 
|
44 | 45 |
|
45 |
| -#### 3. Configure CodeChecker and checkers |
| 46 | +## 3. Configure CodeChecker and checkers |
46 | 47 | After that, the settings can be customized in the project preferences window under the CodeChecker panel. For the plugin to work correctly, it is mandatory to add the correct path to the root of the CodeChecker package. You can download and compile CodeChecker from [here](https://github.com/Ericsson/codechecker).
|
47 | 48 |
|
48 | 49 | 
|
49 | 50 | 
|
50 | 51 |
|
51 | 52 | After the plugin is successfully configured for a project, it'll listen to build events, and automatically rechecks the project with CodeChecker when needed.
|
52 | 53 |
|
53 |
| -#### 4. Set up eclipse C/C++ build environment |
| 54 | +## 4. Set up eclipse C/C++ build environment |
54 | 55 |
|
55 | 56 | The code analysis runs only if your project can be built by Eclipse (as it intercepts gcc build commands).
|
56 | 57 | Please check that your builder is set up correctly in properties/C/C++ Build settings.
|
57 | 58 | If all goes well, you should be able to build your project from Eclipse using the Project/Build Project menu item.
|
58 | 59 |
|
59 |
| -#### 5. Analyze C/C++ project and view results |
| 60 | +## 5. Analyze C/C++ project and view results |
60 | 61 | By default the plugin displays the problems related to the currently selected file on the current file reports view. Here the viewer can decide to check the individual reports selected from the reports tree, and view the related bugpath. Double clicking on a bugpath item will jump and set the cursor to that line in the editor.
|
61 | 62 |
|
62 | 63 | *Please note that codechecker will only show analysis results for files that you built. This means that if you want to see all bugs for your project you will need to do a full (clean) build. After you update a source file, analysis results will be updated when you rebuild your project.*
|
63 | 64 |
|
64 | 65 | 
|
65 | 66 |
|
66 |
| -## Contributing |
| 67 | +# Contributing |
67 | 68 |
|
68 | 69 | For further information see [developer documentation](docs/developer.md).
|
0 commit comments