|
40 | 40 |
|
41 | 41 | The plugin provides the `Show Cppcheck XML Output` action which will show the raw XML output of the latest finished analysis.
|
42 | 42 |
|
43 |
| -## Known Issues |
| 43 | +## Known Issues/Limitations |
| 44 | + |
| 45 | +See https://github.com/johnthagen/clion-cppcheck/issues for a complete list of tracked issues and enhancements requests. |
| 46 | + |
| 47 | +### Analyzing header files |
44 | 48 |
|
45 | 49 | `cppcheck` is not designed to be run on header files (`.h`) directly, as must be done for this
|
46 | 50 | plugin, and as a result may have false positives.
|
47 | 51 |
|
48 | 52 | When run on header files directly, `cppcheck` defaults to C as the language, which will generate
|
49 |
| -false positives for C++ projects. C++ projects should append `--language=c++` to the |
50 |
| -`cppcheck` options. |
| 53 | +false positives for C++ projects. So `--language=c++` is implicitly added as option when analyzing header files. |
| 54 | + |
| 55 | +It will also provide `unusedFunction` and `unusedStructMember` false positives so these findings are being suppressed. |
| 56 | + |
| 57 | +Related issues:<br/> |
| 58 | +https://github.com/johnthagen/clion-cppcheck/issues/22 |
| 59 | +https://github.com/johnthagen/clion-cppcheck/issues/52 |
| 60 | + |
| 61 | +### Analyzing multiple configurations |
| 62 | + |
| 63 | +By default `cppcheck` tries to determine all the available configurations for a file (i.e. all combination of the used |
| 64 | +preprocessor defines). As the plugin doesn't get the current list of defines this may lead to findings shown in code |
| 65 | +which is shown as disabled in the editor. To check just a specific configuration you can either add defines using `-D` |
| 66 | +to the options. Or you can limit the configurations to a single one adding `--max-configs=1`. |
| 67 | + |
| 68 | +By default Limiting the configurations also decreases the time of the analysis. |
| 69 | + |
| 70 | +By default a maximum of 12 configurations is checked. This may lead to some code which might actually be active not to |
| 71 | +show any findings. This can also be controlled by the `--max-configs=<n>` option. |
| 72 | + |
| 73 | +Related issues:<br/> |
| 74 | +https://github.com/johnthagen/clion-cppcheck/issues/34 |
| 75 | +https://github.com/johnthagen/clion-cppcheck/issues/52 |
| 76 | + |
| 77 | +### Multiple include paths |
| 78 | + |
| 79 | +No additional includes path are being passed to `cppcheck` for the analysis which might result in false positives or not |
| 80 | +all findings being shown. |
| 81 | + |
| 82 | +You can add additional include path using the `-I <path>` options. |
| 83 | + |
| 84 | +Related issues:<br/> |
| 85 | +https://github.com/johnthagen/clion-cppcheck/issues/52 |
| 86 | +https://github.com/johnthagen/clion-cppcheck/issues/55 |
51 | 87 |
|
52 |
| -`Show Cppcheck XML Output` only shows the XML result of the latest analysis. If you need to view the results for a |
| 88 | +### Batch analysis |
| 89 | + |
| 90 | +The batch analysis passes the files individually to `cppcheck` just like the highlighting inspections. So if you pass a |
| 91 | +folder to the batch analysis it might not show the same findings as when passing a folder to `cppcheck` itself. |
| 92 | + |
| 93 | +It will also pass all the contents of the folder to the analysis and not just project files. This might lead to |
| 94 | +unexpected findings. |
| 95 | + |
| 96 | +Also some findings in headers files triggered by the analysis of a source files are not being shown. |
| 97 | + |
| 98 | +Related issues:<br/> |
| 99 | +https://github.com/johnthagen/clion-cppcheck/issues/54 |
| 100 | + |
| 101 | +### Showing raw output |
| 102 | + |
| 103 | +`Show Cppcheck XML Output` only shows the XML result of the latest analysis. If you need to view the results for a |
53 | 104 | specific file make sure it was the last one analyzed.
|
54 | 105 |
|
| 106 | +Related issues:<br/> |
| 107 | +https://github.com/johnthagen/clion-cppcheck/issues/53 |
| 108 | + |
| 109 | +### External libraries / System includes |
| 110 | + |
| 111 | +`cppcheck` does not support analyzing of external library or system includes. It provides profiles for several external |
| 112 | +libraries which describe the contents and behavior of the includes which allows it to finding issues with usage of them |
| 113 | +in the code. To add such a profile to your analysis you need to specify it via the `--library=<name>` option. The |
| 114 | +available profile can be found in the `cfg` folder of your `cppcheck` installation. |
| 115 | + |
| 116 | +### Global options |
| 117 | + |
| 118 | +Currently the configured options are global and not per project. |
| 119 | + |
| 120 | +Related issues:<br/> |
| 121 | +https://github.com/johnthagen/clion-cppcheck/issues/52 |
| 122 | + |
55 | 123 | ## Development
|
56 | 124 |
|
57 | 125 | To run the plugin from source, open this project in IntelliJ and create a new "Plugin" run configuration. Running or
|
|
0 commit comments