CodeAuditWeb is a web application designed for developers and coders to test and analyze the performance of their code. Built on FastAPI, it provides an intuitive interface to execute code snippets, analyze execution time, memory usage, and detailed profiling, with additional graphical analysis available. Additionally, it features an endpoint testing tool allowing users to test various HTTP methods.
Currently, this project supports Python, with plans to add support for other languages in the future. Feel free to contribute to the project by adding new analysis strategies or additional language support.
- Execution Time Measurement: Analyze the execution time of code snippets, useful for optimizing code performance.
- Memory Usage Analysis: Measure the memory footprint of code execution, crucial for resource-intensive applications.
- Detailed Profiling:
- Basic Profiling: General code profiling to identify bottlenecks.
- Advanced Profiling: Line-by-line profiling for more in-depth analysis.
- Graph Generation:
- DotGraph: Generate graphical representations of code execution flow.
- FlameGraph: Create flame graphs for performance visualization.
- Supports various HTTP methods: GET, PUT, DELETE, PATCH, POST.
- Customizable requests with URL, header, and body inputs.
Before running CodeAuditWeb, ensure you have the following installed:
- Python 3.x
- pip (Python package manager)
- Graphviz (for graph generation)
- Other Python dependencies listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/JoshCap20/CodeAuditWeb.git cd CodeAuditWeb
-
Install Python dependencies (recommended in a virtual environment):
pip install -r requirements.txt
-
Run the setup script to check and install additional requirements:
python setup.py
-
Run the FastAPI server:
uvicorn main:app --reload
OR
python main.py
(uses default host and port settings from
config.py
)
- Access the web interface at
http://localhost:8000/
. - Enter the code snippet in the provided code editor.
- Choose the desired performance analysis strategies (time, memory, profiling).
- Click 'Run Code' to execute and analyze the code.
- Switch to the Endpoint tab at
http://localhost:8000/endpoint
. - Enter the URL, select the HTTP method, and provide headers and body if necessary.
- Click 'Send Request' to test the endpoint.
The application is modular, allowing easy addition of new analysis strategies and additional language support in the measures
directory. These are used to populate the options in the web interface.
Configuration settings in config.py can be modified as per requirements.