Codebase Maintainability Analyzer
Project description
Maintainability API & CLI 🛠️
Maintainability is a powerful tool that allows you to analyze the maintainability of your codebase. It provides a FastAPI based API and a command-line interface (CLI) to interact with the API. The application calculates various metrics related to code maintainability such as readability, design quality, testability, consistency, and debug error handling.
Why Use Maintainability? 🚀
Maintainability is designed to help you improve the quality of your codebase. It provides you with detailed metrics about your code, which can help you identify areas that need improvement. By using Maintainability, you can ensure that your code is easy to understand, modify, and test, which can save you a lot of time and effort in the long run.
Repo Structure 📂
maintainability
├── api
│ ├── requirements.txt
│ ├── src
│ │ ├── main.py
│ │ ├── models.py
│ │ ├── test_main.py
│ │ └── utils.py
│ └── vercel.json
└── cli
├── cli.py
└── __init__.py
Usage 🖥️
CLI
The CLI provides a simple way to interact with the API. Here's an example of how to use it:
python cli.py --paths /path/to/your/code
This command will analyze the code in the specified paths and return the maintainability metrics.
API
The API provides two main endpoints:
POST /submit_metrics
: This endpoint allows you to submit your metrics to the API. Here's an example of how to use it:
import requests
data = {
"/test/path/testfile.py": {
"maintainability": {
"readability": 1,
"design_quality": 2,
"testability": 3,
"consistency": 4,
"debug_error_handling": 5,
},
"file_info": {
"file_size": 1000,
"loc": 100,
"language": "python",
"content": "print('hello world')",
},
"timestamp": "timestamp",
"session_id": "88888888-8888-8888-8888-888888888888",
}
}
response = requests.post("http://localhost:8000/submit_metrics", json=data)
POST /extract_metrics
: This endpoint allows you to extract metrics from your code. Here's an example of how to use it:
import requests
data = {"/test/path/testfile.py": "print('hello world')"}
response = requests.post("http://localhost:8000/extract_metrics", json=data)
Conclusion 🎉
Maintainability is a powerful tool for improving the quality of your codebase. By providing detailed metrics about your code, it can help you identify areas that need improvement and ensure that your code is easy to understand, modify, and test. Give it a try today!
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
File details
Details for the file maintainability-0.2.2.tar.gz
.
File metadata
- Download URL: maintainability-0.2.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 378c1913811d3ab35dba61cd45ea05cbb17e9f7ae8cc9813ffa2a977fb0d622a |
|
MD5 | 62939c151116db42b83927af8631b993 |
|
BLAKE2b-256 | dad158c4e53f7aac7a0ff028286dafb640746dc1b9f3acee7726732a312d2894 |
File details
Details for the file maintainability-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: maintainability-0.2.2-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abc7c58587b4422687433d2785cc2fc351eaa0f3c5322ab942d65eb5879f449f |
|
MD5 | 3e274ede6ea29059a527ec8886a1936d |
|
BLAKE2b-256 | eb324fcd51981758e34dc633e23244dec10ef53a33412bc156e8ef24ae285698 |