This tool analyzes Python (.py), JavaScript (.js), and JSX (.jsx) files and provides insights such as function definitions, variable assignments, formatting issues, and best practices.
- Supports Python, JavaScript, and JSX files.
- Uses Pylint for Python and ESLint for JavaScript/JSX analysis.
- Provides an overall score and a breakdown of different coding aspects.
- Generates recommendations for code improvements
Before you run the bot, make sure to have the following dependencies installed:
- Python 3.7+
- Node.js (for ESLint support)
- Pylint (pip install pylint)
- ESLint (npm install -g eslint)
- Clone this repository to your local machine:
git clone https://github.com/Mansi08git/AI-Automation-Task.git
- Navigate to the project directory:
cd <project_directory>
- Install required dependencies:
pip install -r requirements.txt
- Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows use venv\\Scripts\\activate
- Start the FastAPI server:
uvicorn main:app --reload
- The API will be available at http://127.0.0.1:8000.
- Navigate to the frontend directory:
cd frontend
- Start the React app:
npx dev
- The frontend will run at http://localhost:3000
- Description: Health check endpoint.
- Response: { "message": "CORS fixed!" }
- Description: Analyzes a Python, JavaScript, or JSX file.
- Request: A file upload (.py, .js, .jsx).
- Response:
{
"overall_score": 85,
"breakdown": {
"naming": 8,
"modularity": 18,
"comments": 20,
"formatting": 14,
"reusability": 13,
"best_practices": 20
},
"recommendations": ["Use camelCase for variable names.", "Refactor large functions."]
}