A code analysis server for the WIT project – a simple version control system that performs static analysis on Python files, keeps history, and generates graphs.
When running on the client side:
wit push– sends all valid Python files from the latest commit to the server (only files without syntax errors).
If a file has a syntax error – it’s skipped, and the user sees an error message.
The server analyzes and looks for:
- Functions that are too long
- Files that are too long
- Missing documentation (Docstring)
- Unused imports
- Use of non-English variable names
- Inside the
resultsfolder, a new folder is created with the current date and time. - Inside that folder:
- A TXT file named
alerts.txtwith all the issues and warnings found. - PNG images for each generated graph.
- A TXT file named
- Does not create a new session.
- Updates a fixed folder named
results/preview. - Inside:
- An updated TXT file with current issues.
- Updated graphs as PNG files.
- Each run of
analyzeoverwrites the previous content in this folder.
The server saves data in a SQL Server database:
- For each project root path.
- For each session (
pushrun), all found issues are saved. - Graphs are also saved as Bytes (to display in a UI or API).
This data is used to generate a line chart showing the trend of issue count over time, across sessions of the project.
- Pie chart – distribution of issues by type
- Bar chart – number of issues per file
- Histogram – distribution of function lengths
- Line chart – trend of issue count over time
On the client side, you can run:
wit push– sends files from the latest commit, saves data and new graphs both in the database and as files.wit analyze– sends files for a temporary analysis only, doesn’t save in the database (only updates the preview folder).
The server listens via REST API at: http://localhost:8000
- Python 3.x
- FastAPI – REST API server
- SQL Server – database
- matplotlib – graph generation
- JSON communication between client and server
Client repo: https://github.com/YeuditY705/wit-client-py
This is a student project for educational purposes only – not for production use.