{"id":25940455,"url":"https://github.com/devehab/green_code_analyzer","last_synced_at":"2026-05-10T16:07:52.353Z","repository":{"id":279869879,"uuid":"940267564","full_name":"Devehab/Green_Code_Analyzer","owner":"Devehab","description":"An AI-powered tool that analyzes code efficiency in terms of energy consumption and resource usage","archived":false,"fork":false,"pushed_at":"2025-02-27T22:28:57.000Z","size":228,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T07:18:23.361Z","etag":null,"topics":["ai","chrome-extension","greencoding"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Devehab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T22:14:00.000Z","updated_at":"2025-02-27T22:30:39.000Z","dependencies_parsed_at":"2025-02-28T07:18:28.431Z","dependency_job_id":"6535f135-5763-48a7-992d-29b2eaf89f29","html_url":"https://github.com/Devehab/Green_Code_Analyzer","commit_stats":null,"previous_names":["devehab/green_code_analyzer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devehab%2FGreen_Code_Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devehab%2FGreen_Code_Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devehab%2FGreen_Code_Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devehab%2FGreen_Code_Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Devehab","download_url":"https://codeload.github.com/Devehab/Green_Code_Analyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787485,"owners_count":20020101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chrome-extension","greencoding"],"created_at":"2025-03-04T05:16:43.774Z","updated_at":"2026-05-10T16:07:47.316Z","avatar_url":"https://github.com/Devehab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌱 Green Code Analyzer\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Chrome Web Store](https://img.shields.io/badge/Chrome-Extension-green.svg)](https://chrome.google.com/webstore)\n[![Version](https://img.shields.io/badge/Version-1.0.0-brightgreen.svg)](https://github.com/yourusername/green-code-analyzer)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![Made with Google Gemini](https://img.shields.io/badge/Made%20with-Google%20Gemini-blue)](https://ai.google.dev/)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/icons/coding.png\" alt=\"Green Code Analyzer Logo\" width=\"128\" height=\"128\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eAnalyze and optimize your code for energy efficiency and reduced carbon footprint\u003c/b\u003e\n\u003c/p\u003e\n\n## 📋 Overview\n\nGreen Code Analyzer is a powerful Chrome extension that leverages Google Gemini AI to analyze code efficiency in terms of energy consumption and resource usage. In an era where software's environmental impact is increasingly important, this tool helps developers write more sustainable and eco-friendly code.\n\n## ✨ Key Features\n\n- **🔍 Intelligent Code Analysis**: Evaluates code patterns and structures for energy efficiency\n- **📊 Efficiency Score**: Provides a clear 0-100 score indicating how energy-efficient your code is\n- **🌍 Carbon Impact Estimation**: Calculates the environmental footprint of your code\n- **💡 Smart Optimization Suggestions**: Offers actionable recommendations to improve efficiency\n- **📄 PDF Report Generation**: Export comprehensive analysis reports in PDF format for sharing and documentation\n- **🔄 Language Comparison**: Ranks programming languages based on energy efficiency\n- **🖱️ Context Menu Integration**: Right-click on any code on the web to analyze it instantly\n- **🔠 Multi-Language Support**: Works with JavaScript, Python, Java, C++, Ruby, and more\n- **🧩 Well-Organized Codebase**: Structured project with separate directories for libraries, CSS, and JavaScript files\n\n## ✨ Screenshots\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eScreenshots will be added soon\u003c/i\u003e\n\u003c/p\u003e\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Google Chrome browser\n- Google Gemini API key (Get yours at [Google AI Studio](https://aistudio.google.com/app/apikey))\n\n### Installation\n\n#### From Chrome Web Store\n1. Visit the [Chrome Web Store](https://chrome.google.com/webstore) (coming soon)\n2. Click \"Add to Chrome\"\n3. Follow the prompts to complete installation\n\n#### Manual Installation (Developer Mode)\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/Devehab/Green_Code_Analyzer.git\n   ```\n2. Open Chrome and navigate to `chrome://extensions/`\n3. Enable \"Developer mode\" in the top-right corner\n4. Click \"Load unpacked\" and select the extension directory\n5. The extension is now installed in your browser\n\n### Configuration\n\n1. Click on the Green Code Analyzer icon in your toolbar\n2. Navigate to Settings (⚙️)\n3. Enter your Google Gemini API key\n4. Customize your default programming language and other preferences\n5. Save your settings\n\n## 💻 How to Use\n\n### Method 1: Using the Extension Popup\n1. Click the Green Code Analyzer icon in your Chrome toolbar\n2. Paste your code into the text area\n3. Select the programming language from the dropdown\n4. Click \"Analyze Code\"\n5. Review the detailed efficiency analysis and recommendations\n6. Click \"Download PDF\" to save a comprehensive report of the analysis\n\n### Method 2: Using the Context Menu\n1. Select code on any webpage\n2. Right-click and select \"Analyze Code for Energy Efficiency\"\n3. The extension will open with the selected code and analyze it automatically\n\n## 🧪 Example Use Cases\n\n- **Web Developers**: Optimize JavaScript and CSS for better performance and lower energy consumption\n- **Backend Developers**: Identify resource-intensive algorithms and database queries\n- **DevOps Teams**: Analyze deployment scripts for efficiency\n- **Students**: Learn best practices for writing environmentally-friendly code\n- **Tech Leads**: Enforce green coding standards across teams\n- **Documentation**: Generate and share PDF reports of code analysis with team members or stakeholders\n\n## 📄 PDF Reports Feature\n\nThe Green Code Analyzer provides comprehensive PDF reports that capture all aspects of your code analysis. These reports are designed to be shared with team members, included in documentation, or used for tracking improvements over time.\n\n### What's Included in the PDF Report:\n\n- **Analysis Summary**: Overall efficiency score and carbon impact metrics\n- **Code Details**: The analyzed code snippet with proper formatting and syntax highlighting\n- **Recommendations**: Detailed suggestions for improving code efficiency\n- **Energy Comparison**: How your code compares to industry standards\n- **Timestamp**: When the analysis was performed for reference\n\n### How to Generate and Use PDF Reports:\n\n1. **Generate a Report**: After analyzing your code, click the \"Download PDF\" button in the results section\n2. **Customize Report Content**: All analyzed content is automatically included in the report\n3. **Share with Stakeholders**: Send the PDF to team members, managers, or clients to demonstrate your commitment to green coding practices\n4. **Documentation**: Include the reports in your project documentation to track efficiency improvements\n5. **Code Reviews**: Use the reports during code reviews to identify areas for optimization\n\n### PDF Report Technical Features:\n\n- **Multi-page Support**: Handles reports of any length with proper pagination\n- **UTF-8 Encoding**: Properly displays code in multiple programming languages\n- **Responsive Layout**: Adapts content to fit within the page boundaries\n- **Consistent Formatting**: Professional design with clear section separation\n\n## 🛠️ Technologies Used\n\n- **Google Gemini AI**: Powers the intelligent code analysis\n- **JavaScript**: Core extension functionality\n- **HTML/CSS \u0026 TailwindCSS**: User interface design\n- **jsPDF \u0026 html2canvas**: PDF report generation capabilities\n- **Chrome Extension API**: Browser integration\n- **Font Awesome**: UI icons and visual elements\n\n## 🤝 Contributing\n\nContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more information.\n\n## 📁 Project Structure\n\nThe Green Code Analyzer follows a clean, organized directory structure:\n\n```\ngreen-code-analyzer/\n├── assets/            # Static assets\n│   └── icons/         # Extension icons in various sizes\n├── css/               # Stylesheet files\n│   └── styles.css     # Main stylesheet\n├── html/              # HTML pages\n│   ├── options.html   # Settings page\n│   ├── error.html     # Error handling page\n│   ├── welcome.html   # Welcome/onboarding page\n│   └── ...            # Other HTML pages\n├── js/                # JavaScript files\n│   ├── background/    # Background scripts\n│   ├── content/       # Content scripts\n│   ├── popup/         # Popup UI scripts\n│   ├── options/       # Settings page scripts\n│   └── ...            # Other JS files\n├── libs/              # Third-party libraries\n│   ├── jspdf.umd.min.js    # PDF generation library\n│   └── html2canvas.min.js  # HTML to canvas conversion\n├── manifest.json      # Extension manifest\n├── popup.html         # Main extension popup\n├── README.md          # Project documentation\n└── CONTRIBUTING.md    # Contribution guidelines\n```\n\nThis structure makes the codebase more maintainable, easier to navigate, and follows best practices for Chrome extension development.\n\n## 🔮 Roadmap\n\n- [ ] Support for more programming languages and frameworks\n- [ ] Integration with popular code editors (VS Code, JetBrains)\n- [ ] Historical tracking of code efficiency improvements\n- [ ] Team collaboration features\n- [ ] Detailed reports and analytics dashboard\n- [ ] CI/CD pipeline integration\n- [ ] Customizable PDF report templates\n- [ ] Batch analysis of multiple files\n\n## 🔧 Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| API Key Issues | Ensure your Google Gemini API key is valid and correctly entered in settings |\n| Extension Not Working | Try reloading the extension from Chrome's extensions page |\n| Analysis Errors | Make sure your code is properly formatted and the correct language is selected |\n| Slow Performance | For large code blocks, try analyzing smaller sections |\n\n## 📝 License\n\nDistributed under the GNU General Public License v3.0. See `LICENSE` for more information.\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n## 👏 Acknowledgements\n\n- [Google Gemini AI](https://ai.google.dev/) for providing the powerful AI capabilities\n- [TailwindCSS](https://tailwindcss.com/) for the UI framework\n- [Font Awesome](https://fontawesome.com/) for the icons\n- [Chrome Extension API](https://developer.chrome.com/docs/extensions/) for making browser extensions possible\n- All contributors who have helped shape this project\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eMade with 💚 for a greener digital future\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/yourusername/green-code-analyzer/issues\"\u003eReport Bug\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/yourusername/green-code-analyzer/issues\"\u003eRequest Feature\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevehab%2Fgreen_code_analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevehab%2Fgreen_code_analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevehab%2Fgreen_code_analyzer/lists"}