Skip to content

gautam-shetty/xStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xStats

Static analysis tool designed to calculate code metrics for Java and Python projects.

Features

Currently supported code metrics and their descriptions

Metric Description Java Python
is_broken If it has any error or missing node
aloc Actual lines of code
eloc Empty lines of code
cloc Comments lines of code
dcloc Document comments lines of code
noi number of imports
noc number of classes
nom number of methods
cc Cyclomatic complexity
pc Parameter count
language Language of the code block
file_path Path of the file
start_row Start row of the code block
start_col Start column of the code block
end_row End row of the code block
end_col End column of the code block
node_name Name of the node
node_type Type of the node

Note: If the node is broken, the rest of the metrics might not be accurate

Supported file extensions

  • Java: .java
  • Python: .py

Usage

You can download the latest release artifacts from the releases page.

To analyze repositories using xStats, run the following command:

xStats --target <TARGET> --output <OUTPUT>
Options
  • -t, --target <TARGET>: Specify the target file or directory.
  • -o, --output <OUTPUT>: Specify the output file.
  • -a, --all-commits: Analyze all commits.
  • --format <FORMAT>: Specify the output format (default: json).
  • -h, --help: Print help information.
  • -V, --version: Print version information.

How to build

  1. Ensure you have Rust installed on your machine. If not, you can install it from here
  2. Clone the repository
git clone https://github.com/gautam-shetty/xStats.git
cd xStats
  1. Build the project
cargo build --release