Analysis levels
The -a / --analysis-level flag selects how much work codeanalyzer-java does. There are two levels.
| Level | Produces | Builds the project? | Relative cost |
|---|---|---|---|
| 1 (default) | symbol_table only | No (source parse only) | Fast |
| 2 | symbol_table + call_graph | Yes, by default | Slower |
Level 1 — Symbol table
Section titled “Level 1 — Symbol table”java -jar codeanalyzer-2.3.7.jar -i /path/to/project -a 1 -o ./outputLevel 1 runs only the Javaparser pipeline. It parses every .java file and produces the symbol table: all types, their fields, methods and constructors, comments, and imports — with source locations, method bodies, and cyclomatic complexity.
It does not build the project. Library dependencies are still downloaded for type resolution (so qualified names resolve), but no compilation of your code is required. This makes level 1 the fast path, suitable when you only need program structure — not who-calls-whom.
Level 2 — Symbol table + call graph
Section titled “Level 2 — Symbol table + call graph”java -jar codeanalyzer-2.3.7.jar -i /path/to/project -a 2 -o ./output -vLevel 2 does everything level 1 does, then runs WALA to build an interprocedural call graph. The result is a call_graph array of caller→callee edges added alongside the symbol table.
Because WALA analyzes the compiled program, level 2 builds the project by default (auto-detecting Maven or Gradle). You can control this:
-b "<cmd>"— supply a custom build command instead of auto-build.--no-build— skip building entirely; use this when the project is already compiled.
See Build integration for how the build is invoked.
Choosing a level
Section titled “Choosing a level”- Use level 1 when you need the program’s structure: listing classes and methods, reading method bodies, finding fields, extracting Javadoc, surveying imports, or doing incremental per-file updates.
- Use level 2 when you need reachability or call relationships: who calls a method, what a method transitively reaches, or seeding a taint/reachability query from an entry point.