Java Knowledge Base files
This section explains Java Knowledge Base (JKB) files. A JKB file tunes specific Klocwork issue Java Path checkers, by providing additional context about your code system to do the following:
- Evaluate issue validity along specific code paths, to reduce false positives
- Identify code paths needed to detect previously missed issues (false negatives)
- Increase reporting of specific issues of concern
You also encounter JKB files when you create your own Java Path checkers.
A JKB file is written in JKB format, a declarative language for JKB specification similar to Java. The JKB file defines the code paths that a checker should include or exclude.
Use traceback information in Klocwork analysis results to do the following:
- Identify the criteria used to determine whether specific code paths should be included or excluded
- Pinpoint the source to include in your JKB file to reduce false positives
To communicate the criteria to the analysis engine, a JKB file includes the following:
- Java methods (functions) in your codebase that are relevant to you
- JKB annotations that indicate how these items are to be handled, for example:
@Bindto specify which checker should be tuned@Check,@CheckTrue,@CheckFalse, and@Wipeto specify data validation to reduce false positives@Source,@Sink, and@Propto report more issues
To learn more about annotations, see the Java Knowledge Base reference.
For your tuning changes to take effect, you must run a full build analysis.