Metadata-Version: 2.4
Name: qdiff
Version: 1.0.1
Summary: Diff tool for code quality analysis reports
License: MPL-2.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# 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:

```bash
pip install -e .
```

This installs `qdiff` in **editable mode**, allowing you to modify the source code without reinstalling.

Verify installation:

```bash
qdiff --help
```

---

## Usage (Command Line)

### Basic syntax

```bash
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

```bash
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

```bash
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

```python
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

```bash
python -m pip install build
```

### Build

```bash
python -m build
```

Artifacts will be created in:

```
dist/
```

