Secure Code AI is an advanced AI-powered code security analyzer that helps developers identify and fix security vulnerabilities in their code. The tool provides detailed analysis, recommendations, and visual reporting to improve code security.
- Multi-language Support: Analyze code in Python, JavaScript, Java, C, C++, PHP, Ruby, and Go
- Detailed Vulnerability Analysis: Identifies common security issues such as:
- SQL Injection
- Cross-Site Scripting (XSS)
- Command Injection
- Buffer Overflows
- Insecure Deserialization
- Hardcoded Secrets
- And more...
- Severity Classification: Vulnerabilities are categorized as High, Medium, or Low severity
- Visual Reporting: Interactive charts and highlighted code sections for easy understanding
- Line-specific Feedback: Identifies the exact line where vulnerabilities occur
- Detailed Recommendations: Provides actionable advice to fix each vulnerability
- Code Highlighting: Syntax highlighting for better code readability
- Dark/Light Theme Support: Customizable UI for different preferences
- HTML5, CSS3, JavaScript
- Bootstrap 5
- Chart.js for data visualization
- Highlight.js for code syntax highlighting
- Font Awesome for icons
- Python
- Flask web framework
- Regular expressions for code analysis
- Python 3.6 or higher
- Node.js and npm (optional, for development)
- Clone the repository
git clone https://github.com/Kishan-Patel-dev/AI-Code-Security-Analyzer.git
cd AI-Code-Security-Analyzer
- Set up the backend
cd backend
pip install -r requirements.txt # Install required Python dependencies
- Start the backend server
python app.py
- Set up the frontend
cd ../frontend
npm install # Optional: Install dependencies if using npm for development
- Start the frontend
# You can use any static file server to serve the frontend files
# For example, with Python:
python -m http.server 8000
- Open your browser and navigate to
http://localhost:8000
- Visit the application in your web browser.
- Drag and drop your code file or use the "Browse Files" button to upload a single file.
- Alternatively, upload a zipped project folder using the "Scan Project" feature.
- You can also scan a GitHub repository by entering its URL in the "Scan Git Repository" section.
- Wait for the analysis to complete.
- Review the identified vulnerabilities with their severity levels.
- Click on any vulnerability to see detailed information, including:
- Description of the vulnerability
- The affected code snippet
- Potential impact
- Recommended fix
- Reference links for further reading
- Use the highlighted source code view to locate the exact location of issues.
Secure Code AI supports scanning GitHub repositories for vulnerabilities. Follow these steps:
- Enter the GitHub repository URL in the "Scan Git Repository" section of the application.
- Click the "Scan Repository" button.
- The application will download the repository, analyze its contents, and display the results.
- Review the vulnerabilities and recommendations in the results section.
- Python (
.py
) - JavaScript (
.js
) - Java (
.java
) - C (
.c
) - C++ (
.cpp
) - PHP (
.php
) - Ruby (
.rb
) - Go (
.go
)
secure-code-ai/
├── backend/
│ └── app.py # Flask backend server and vulnerability analyzers
├── frontend/
│ ├── index.html # Main HTML file
│ ├── style.css # CSS styles with light/dark theme support
│ └── script.js # Frontend JavaScript for UI interaction
└── uploads/ # Directory for uploaded code files (auto-created)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
To add support for a new programming language:
- Add a new analyzer function in
app.py
- Update the
ALLOWED_EXTENSIONS
andlanguage_map
inapp.py
- Add appropriate vulnerability detection patterns
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Kishan Patel
- GitHub: Kishan-Patel-dev
- Twitter: KishanPatel_dev
- LinkedIn: kishan-patel-dev
- OWASP for security vulnerability information
- Bootstrap
- Chart.js
- Highlight.js