Native implementation of source code analysis tool for Enterprise Rust Applications.
Before you begin, ensure you have met the following requirements:
- You have a Linux/MacOS/WSL machine.
- You have installed the latest version of Rustup
-
Install Rustup by running the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Follow the on-screen instructions to complete the installation.
-
Open a new terminal or source the Rust environment:
source $HOME/.cargo/env
-
Ensure you have Rust installed:
rustc --version
If Rust is not installed, install it using Rustup:
rustup install stable
-
Set Rust stable as the default version:
rustup default stable
Clone the repository (if you haven't already) and navigate into the cloned directory.
Run the Cargo build command to compile the project:
cargo build --release
The binary will be built at target/release/codeanalyzer
. It may be used as follows:
Usage: ./codeanalyzer [-hvV] [--no-build] [-a=<analysisLevel>] [-i=<input>] [-o=<output>] [-s=<sourceAnalysis>]
Convert Rust binary into a comprehensive system dependency graph.
-i, --input=<input> Path to the project root directory.
-s, --source-analysis=<sourceAnalysis>
Analyze a single Rust source file instead of the project.
-o, --output=<output> Destination directory to save the output graphs. By default, the SDG formatted as JSON will be printed to the console.
-a, --analysis-level=<analysisLevel>
Level of analysis to perform. Options: 1 (for just symbol table) or 2 (for call graph). Default: 1
-v, --verbose Print logs to console.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
To generate and view the documentation for this project:
-
Generate the documentation:
cargo doc --no-deps
-
Open the generated documentation in your default web browser:
cargo doc --no-deps --open
The documentation includes detailed API reference, examples, and implementation details of the codeanalyzer library.
To install codeanalyzer
, follow these steps: