Keep your analysis up to date¶
Understand analyzes your code once and stores the results in the .und database. When source files
change, the database becomes out of date for those files until you re-analyze.
Re-analyze in the GUI¶
Two actions on the Project menu:
- Analyze Changed Files (
Ctrl+R) — the everyday choice. Re-parses only files that changed since the last analysis. Fast, because unchanged files are left alone. - Analyze All Files (
Ctrl+Alt+R) — re-parses everything from scratch. Use it after changing project-wide settings (includes, macros, language options) or if results look stale or inconsistent.
New and deleted files in Watched directories are detected automatically on the next analysis, so you rarely need to add files by hand — see Manage your project's files.
Re-analyze from the command line¶
und analyze -changed myProject.und # only files changed since last analyze
und analyze -all myProject.und # everything (this is the default)
und analyze -files file1.cpp file2.cpp myProject.und
und analyze with no switch analyzes all files — full switch list in the
und analyze reference.
When a re-analyze is needed¶
A file's parse can be in one of three states: up to date, out of date (the source changed since it was parsed), or not parsed yet. Re-analyze when:
- You edited, added, or removed source files.
- You changed project settings — includes, macros, filters, or language versions. These affect how files parse, so run Analyze All Files.
- You upgraded Understand and the parser version changed — Understand re-analyzes the affected languages automatically.
Tip
In scripts, und add -analyzelater … adds files without triggering an immediate analysis, so you
can batch several changes and run one und analyze -changed at the end. See
The und command line.