Diff tool for code quality analysis reports
Project description
qdiff
qdiff is a command-line tool and Python library for computing differences between two code quality analysis reports. It helps developers and researchers understand how code quality differs between two versions of a project.
qdiff is designed to work both as:
- ✅ an installable console application
- ✅ a reusable Python package
Features
-
🔍 Compare two code quality reports
-
📊 Generate a diff report in a specified output directory
-
🛠️ Supports multiple source tools:
dpy– DPy (for Python code analysis)dc– Designite (for C# code analysis)dj– DesigniteJava (for Java code analysis)
-
🔌 Clean Python API for integration into scripts, experiments, and dashboards
-
🤖 CI-friendly command-line interface
Installation
Prerequisites
- Python 3.9 or higher
pip
Install locally (development mode)
From the project root directory:
pip install -e .
This installs qdiff in editable mode, allowing you to modify the source code without reinstalling.
Verify installation:
qdiff --help
Usage (Command Line)
Basic syntax
qdiff path1 path2 path3 tool
Arguments
| Argument | Description |
|---|---|
path1 |
Path to the first code quality report directory |
path2 |
Path to the second code quality report directory |
path3 |
Path to the output directory for the diff report |
tool |
Source tool that generated the reports (dpy, dc, or dj) |
Example
qdiff reports/v1 reports/v2 reports/diff dpy
This compares:
- report from
reports/v1 - report from
reports/v2 - writes the diff to
reports/diff - assumes reports were generated by DPy
Help
qdiff --help
This displays full usage instructions and available options.
Usage as a Python Library
You can import and use qdiff directly in your Python code.
Example
from qdiff.smell_diff import SmellDiff
# The parameters define the columns in the dataframe to be treated as key and description columns; the description column can be passed an empty list
smell_diff = SmellDiff(['Project', 'Package', 'Class', 'Smell'],['Description'])
# read_csv is a simple function that read csv files using pandas library and return corresponding dataframes
df_old, df_new = read_csv('/path/to/ver1/DesignSmells.csv',
'/path/to/ver2/DesignSmells.csv')
diff_df = smell_diff.diff(df_old, df_new)
Building the Package (Optional)
If you want to create distributable artifacts (wheel + source archive):
Install build tool
python -m pip install build
Build
python -m build
Artifacts will be created in:
dist/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qdiff-1.0.1.tar.gz.
File metadata
- Download URL: qdiff-1.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
148b95d6632af7aa00087b1452a36da6d5969f2f5a02fcc9a0df1a3a28311c8b
|
|
| MD5 |
6a9f4013cffdd5e83117a2891d3c6099
|
|
| BLAKE2b-256 |
25da9608f9b54c463d5f8f357e2301840dc6d59c9b6a75ba463606e37fa32ef4
|
File details
Details for the file qdiff-1.0.1-py3-none-any.whl.
File metadata
- Download URL: qdiff-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
194422326fa1335896687446e3b50b0f235a6d37949ff9e06a8764d694457aec
|
|
| MD5 |
555405f056b8195053f37f6281d1c54d
|
|
| BLAKE2b-256 |
d3815c8e7e364fae3b4174151a528d75d56873fc10020de280a6b3b6ae27c506
|