Skip to content

Server side for WIT – built with FastAPI. Receives Python code from the client, performs static analysis, saves results and generates graphs. Uses SQL Server for storing analysis sessions.

Notifications You must be signed in to change notification settings

YeuditY705/wit-server-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIT – Server Side - FastAPI

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.


What does the server check?

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

Where is the data saved?

On wit push

  • Inside the results folder, a new folder is created with the current date and time.
  • Inside that folder:
    • A TXT file named alerts.txt with all the issues and warnings found.
    • PNG images for each generated graph.

On wit analyze

  • 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 analyze overwrites the previous content in this folder.

Database

The server saves data in a SQL Server database:

  • For each project root path.
  • For each session (push run), 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.


Graphs generated by the server

  • 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

How it integrates with the client

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


Technologies used

  • Python 3.x
  • FastAPI – REST API server
  • SQL Server – database
  • matplotlib – graph generation
  • JSON communication between client and server

Link to the client repository

Client repo: https://github.com/YeuditY705/wit-client-py


License

This is a student project for educational purposes only – not for production use.

About

Server side for WIT – built with FastAPI. Receives Python code from the client, performs static analysis, saves results and generates graphs. Uses SQL Server for storing analysis sessions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages