Skip to content
TSsanjayyPublic

About

**DECODE** is an AI-powered code analysis tool that helps beginners understand programs. It breaks code into meaningful segments, explains their purpose, and provides time complexity, space complexity, functions, variables, and keyword analysis through an interactive Streamlit interface.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

🧠 DECODE

AI-Powered Code Analysis & Explanation Tool

DECODE is an AI-powered code analysis tool designed to help beginners understand programs more easily.

It analyzes the submitted code, divides it into meaningful logical segments, explains what each section does, identifies important functions and variables, and provides time and space complexity analysis.


✨ Features

  • 🔍 Breaks code into meaningful logical segments
  • 💡 Provides beginner-friendly explanations
  • 🐛 Detects common syntax and logical issues
  • 📊 Analyzes time complexity
  • 💾 Analyzes space complexity
  • 🔑 Identifies important functions and variables
  • 🏷️ Identifies important programming keywords
  • ⚡ Provides code improvement suggestions
  • 📚 Gives line-by-line explanations
  • 🤖 Uses Google Gemini AI for intelligent analysis
  • 🎨 Interactive Streamlit interface
  • 🧑‍💻 Designed especially for programming beginners

🛠️ Technologies Used

  • Python – Core programming language
  • Streamlit – Web application interface
  • Google Gemini API – AI-powered code analysis
  • python-dotenv – Environment variable management

🤖 AI Model

DECODE uses the Google Gemini API to analyze and explain user-submitted code.

The application sends the user's code and analysis instructions to the Gemini model and displays the generated explanation through the Streamlit interface.

The model can be selected from the application's settings.


🔐 API Key

DECODE requires a Google Gemini API key to perform AI-based analysis.

The API key can be entered directly through the application's sidebar.

For local development, the API key can also be stored in a .env file:

GEMINI_API_KEY=your_api_key_here

🧪 Testing

The application was tested during development using multiple Python programs and different types of code inputs.

Tests performed ✅ Simple Python programs ✅ Programs containing loops ✅ Conditional statements ✅ Functions ✅ Variables and data structures ✅ Different code lengths ✅ Time complexity analysis ✅ Space complexity analysis ✅ Invalid/problematic code inputs ✅ Gemini API connectivity ✅ Streamlit deployment

The Gemini API was tested multiple times during development to verify that the application could successfully send code, receive an AI response, and display the result.

API availability and usage limits depend on the Gemini model and the limits associated with the user's Google AI account.

⚡ Performance

The response time depends mainly on:

Internet connection Gemini API response time Size and complexity of the submitted code Current API/server load Selected Gemini model

Short programs generally receive responses faster than large programs.

⚠️ Limitations

DECODE currently has some limitations:

Requires an internet connection AI analysis depends on the Gemini API. Requires a valid Gemini API key Without an API key, AI-powered analysis cannot be performed. API usage limits Free Gemini API usage is subject to Google's current rate limits and quotas. Limits may vary depending on the selected model and account. AI-generated explanations Explanations are generated by an AI model and may occasionally contain mistakes. Very large programs Extremely large code inputs may take longer to process or may exceed model input limits. Programming language support Analysis quality depends on the selected language and the Gemini model's ability to understand that language. Response speed The application may appear slow when the Gemini API takes longer to respond.

🚀 How to Run Locally

  1. Clone the repository git clone https://github.com/TSsanjayy/Decode.git
  2. Open the project cd Decode
  3. Create a virtual environment python -m venv venv
  4. Activate the virtual environment

Windows:

venv\Scripts\activate 5. Install dependencies pip install -r requirements.txt 6. Add your Gemini API key

Create a .env file:

GEMINI_API_KEY=your_api_key_here 7. Run the application streamlit run app.py

The application will open in your browser.

☁️ Deployment

DECODE can be deployed using Streamlit Community Cloud.

The application is connected to the GitHub repository and uses requirements.txt to install the required Python packages.

For deployment, the Gemini API key should be added through the application's deployment secrets/settings rather than being uploaded to GitHub.

🎯 Project Objective

The main objective of DECODE is to make programming easier for beginners by transforming complicated source code into simple, understandable explanations.

Instead of only showing the final output of a program, DECODE focuses on explaining:

What the code does Why each section is present How the logic works Which functions and variables are important How efficient the algorithm is

🔮 Future Improvements

Possible future improvements include:

🌐 Support for more programming languages 📈 Improved complexity analysis 🐞 More advanced error detection 📝 Automatic code documentation 💬 Improved AI chat-based code tutoring 📊 Visual representation of algorithms ⚡ Faster response processing 🔄 Multiple AI model support 📥 Export analysis as PDF or document

About

**DECODE** is an AI-powered code analysis tool that helps beginners understand programs. It breaks code into meaningful segments, explains their purpose, and provides time complexity, space complexity, functions, variables, and keyword analysis through an interactive Streamlit interface.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages