Giter VIP home page Giter VIP logo

joshcap20 / codeauditweb Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.8 MB

A FastAPI-based web tool for comprehensive performance analysis and endpoint testing of code, featuring execution time tracking, memory usage, and detailed profiling.

License: MIT License

Python 58.96% HTML 3.61% CSS 5.70% JavaScript 31.73%
code-optimization code-profiling developer-tools endpoint-testing execution-time fastapi memory-usage performance-analysis python

codeauditweb's Introduction

CodeAuditWeb

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.

Features

Code Testing and Analysis

  • 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.

Endpoint Testing

  • Supports various HTTP methods: GET, PUT, DELETE, PATCH, POST.
  • Customizable requests with URL, header, and body inputs.

Demo

Code Testing

Code Testing Demo

Endpoint Testing

Endpoint Testing Demo

Getting Started

Prerequisites

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

Installation

  1. Clone the repository:

    git clone https://github.com/JoshCap20/CodeAuditWeb.git
    cd CodeAuditWeb
  2. Install Python dependencies (recommended in a virtual environment):

    pip install -r requirements.txt
  3. Run the setup script to check and install additional requirements:

     python setup.py
  4. Run the FastAPI server:

    uvicorn main:app --reload

    OR

     python main.py

    (uses default host and port settings from config.py)

Usage

Code Testing

  1. Access the web interface at http://localhost:8000/.
  2. Enter the code snippet in the provided code editor.
  3. Choose the desired performance analysis strategies (time, memory, profiling).
  4. Click 'Run Code' to execute and analyze the code.

Endpoint Testing

  1. Switch to the Endpoint tab at http://localhost:8000/endpoint.
  2. Enter the URL, select the HTTP method, and provide headers and body if necessary.
  3. Click 'Send Request' to test the endpoint.

Modularity and Customization

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.

codeauditweb's People

Contributors

joshcap20 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.