Header analysis in Eclipse

In Eclipse, you can fix header issues by using the Analyze Headers and Optimize Headers refactoring options by right-clicking anywhere in your current file and selecting Klocwork > Analyze Headers or Optimize Headers.

The Analyze Headers and Optimize Headers menu options are controlled by the Header Analysis checkers. If you disable these checkers, the header analysis refactoring will not be available.

When you use the Analyze Headers refactoring option, unnecessary or missing transitive includes are identified in the current file with a marker that activates a Quick Fix pop-up that provides a refactoring suggestion.

  1. Right-click anywhere in your current file and select Klocwork > Analyze Headers. (You don't have to select any code to analyze your headers).
  2. Click the bug marker or just scroll to your header files to see the Quick Fix icon: .
  3. Click or use <Ctrl+1> to activate the Quick Fix pop-up.
  4. Click the pop-up to proceed with the refactoring.

When you use the Optimize Headers refactoring option, all of the fixes are done for you without the need to go through and fix each individual marker in the file.

Related Topics Link IconSee also