Skip to content

Commit 6e2dfd3

Browse files
committed
refac: #1117 update docs
- reworded the first sentences to make it clearer - removed project structure as requested - removed sentence about rust installation - replaced `cargo run` with respective command
1 parent c133f6a commit 6e2dfd3

File tree

2 files changed

+17
-46
lines changed

2 files changed

+17
-46
lines changed

rust-code-analysis-cli/README.md

+7-19
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,23 @@
66

77
- Analyze source code for different programming languages.
88
- Export results in different formats (CBOR, JSON, TOML, YAML).
9-
- Perform various operations on source code (e.g., dumping abstract syntax tree to stdout, count nodes, computing code metrics).
10-
11-
## Project Structure
12-
13-
```sh
14-
rust-code-analysis-cli
15-
├── Cargo.toml # Project metadata and dependencies
16-
└── src
17-
├── formats.rs # Handles format-specific output (CBOR, JSON, TOML, YAML)
18-
└── main.rs # Main logic for command-line operations and code analysis
19-
```
9+
- Perform various operations on source code (e.g., dumping abstract syntax tree to stdout, counting nodes, computing code metrics).
2010

2111
## Installation
2212

23-
To use this tool, you need to have Rust installed on your system.
24-
25-
Clone the repository and run the following command:
13+
Clone the repository and build the project:
2614

2715
```sh
2816
cd rust-code-analysis-cli/
29-
cargo build --debug # or cargo build --release
17+
cargo build
3018
```
3119

3220
## Usage
3321

3422
Run the tool by specifying the input file and the desired operation:
3523

3624
```sh
37-
cargo run -- [OPTIONS]
25+
rust-code-analysis-cli [OPTIONS]
3826
```
3927

4028
## Available Options
@@ -47,13 +35,13 @@ cargo run -- [OPTIONS]
4735
- `-C, --count <NODE_TYPE>`: Count nodes of the given type.
4836
- `-m, --metrics`: Compute code metrics.
4937
- `--ops`: Retrieve all operands and operators in the code.
50-
- `-i, --in-place`: Do actions in place.
38+
- `-i, --in-place`: Perform actions in place.
5139
- `-I, --include [<INCLUDE>...]`: Include files matching the given pattern.
5240
- `-X, --exclude [<EXCLUDE>...]`: Exclude files matching the given pattern.
5341
- `-j, --num-jobs <NUM_JOBS>`: Number of threads to use.
5442
- `-l, --language-type <LANGUAGE>`: Language of the input files.
5543
- `-O, --output-format <FORMAT>`: Output format for the results (CBOR, JSON, TOML, YAML).
56-
- `--pr`: Dump a pretty json output file.
44+
- `--pr`: Dump a pretty JSON output file.
5745
- `-o, --output <OUTPUT>`: Output directory for the results.
5846
- `--preproc <PREPROCESSOR>`: Get preprocessor directives for C/C++ files.
5947
- `--ls <LINE_START>`: Start line for the analysis.
@@ -67,5 +55,5 @@ cargo run -- [OPTIONS]
6755
To analyze the code in a file and export the metrics in JSON format:
6856

6957
```sh
70-
cargo run -- --metrics --output-format json --output . --paths path/to/file.rs
58+
rust-code-analysis-cli --metrics --output-format json --output . --paths path/to/file.rs
7159
```

rust-code-analysis-web/README.md

+10-27
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,30 @@
11
# rust-code-analysis-web
22

3-
`rust-code-analysis-web` is a web server that facilitates the analysis of source code through a RESTful API. It is part of the rust-code-analysis suite and allows developers to remotely interact with the code analysis features provided by the library.
3+
`rust-code-analysis-web` is a web server that provides source code analysis capabilities via a RESTful API. It enables developers to interact with the code analysis functionality from the rust-code-analysis suite through HTTP requests.
44

55
## Features
66

7-
- **Comment Removal**: Removes comments from source code to produce a clean version.
8-
- **Function Spans**: Retrieves the start and end lines of functions in the provided source code.
9-
- **Metrics Calculation**: Computes various static analysis metrics for the source code.
7+
- **Comment Removal**: Removes comments from source code to provide a cleaner version of the code.
8+
- **Function Spans**: Retrieves the start and end lines of functions in the given source code.
9+
- **Metrics Calculation**: Computes static analysis metrics for the source code.
1010

11-
## Project Structure
12-
13-
```sh
14-
rust-code-analysis-web
15-
├── Cargo.toml # Project metadata, dependencies, and build configuration
16-
└── src
17-
├── bin/
18-
│ └── rust-code-analysis-web.rs # Entry point for running the web server with CLI options
19-
├── web/
20-
│ ├── comment.rs # Logic for handling requests related to removing comments from source code
21-
│ ├── function.rs # Logic for extracting and returning function spans from the source code
22-
│ ├── metrics.rs # Logic for computing and returning code metrics based on the source code
23-
│ ├── mod.rs # Module declarations and routing between web modules
24-
│ └── server.rs # Actix web server setup, route definitions, and main server handler logic
25-
└── lib.rs # Main library file, sets up the module imports and starts the server
26-
```
11+
Refer to the REST API documentation for detailed information about the available endpoints and parameters.
2712

2813
## Installation
2914

30-
To use `rust-code-analysis-web`, you need to have Rust installed on your system.
31-
32-
Clone the repository and run the following command:
15+
Clone the repository and build the project:
3316

3417
```sh
3518
cd rust-code-analysis-web/
36-
cargo build --debug # or cargo build --release
19+
cargo build
3720
```
3821

3922
## Usage
4023

4124
Run the server by specifying the host and port:
4225

4326
```sh
44-
cargo run -- [OPTIONS]
27+
rust-code-analysis-web [OPTIONS]
4528
```
4629

4730
### Available Options
@@ -52,10 +35,10 @@ cargo run -- [OPTIONS]
5235
- `-h, --help`: Show help information.
5336
- `-v, --version`: Show version information.
5437

55-
# Examples
38+
## Examples
5639

5740
To start the server on a specific host and port:
5841

5942
```sh
60-
cargo run -- --host <HOST> --port <PORT> -j <NUM_JOBS>
43+
rust-code-analysis-web --host <HOST> --port <PORT> -j <NUM_JOBS>
6144
```

0 commit comments

Comments
 (0)