Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Replacing the path to your source files

You can replace or simply shorten the directory structure for source files displayed in Klocwork tools with the kwbuildproject option --replace-path <original>=<new>. This option replaces one substring in the absolute file path with a user-defined path.

Replacing the path to source files is helpful in two situations:

  • When the source files are located deep in the file system tree. You can specify a build prefix to remove unnecessary directories displayed in all Klocwork tools (such as Klocwork Static Code Analysis reports).
  • When the source files for each analysis run are stored in a separate location. You can specify a build prefix to keep model and source file paths persistent from build to build.

For example, the kwbuildproject option

--replace-path /dev/projects/project1/v_03/source=/source

causes all path names to source files displayed in Klocwork tools to start with /source instead of /dev/projects/project1/v_03/source.

Tip: If you make a mistake in setting the --replace-path option, run kwbuildproject again with the option set properly.