Header Analysis
Header Analysis allows you to fix problems with the include structure of your code, which can add to compile time and make the system difficult to maintain.
These problems can be solved with Klocwork refactorings described below. To learn more, watch the Klocwork demo.
Analyze Headers
Analyze Headers identifies unnecessary or missing transitive includes and presents a refactoring suggestion.
The functionality of this refactoring option is dependent on your choice of IDE.
- For Visual Studio, see Header analysis in Visual Studio.
- For Eclipse, see Header analysis in Eclipse.
Optimize Headers
Use the Optimize Headers refactoring option to find and refactor unnecessary or missing includes in one step, without prompting from you. This is in slight contrast to Analyze Headers, which notifies you of unnecessary or missing transitive includes and presents you with the refactoring suggestion that you can implement or not.
For both Visual Studio and Eclipse, right-click anywhere in your current file and select Klocwork > Optimize Headers. (You don't need to select any code to optimize headers.)