{"id":25056542,"url":"https://github.com/ascender1729/codesage","last_synced_at":"2026-05-01T15:32:42.275Z","repository":{"id":247994385,"uuid":"827450144","full_name":"ascender1729/CodeSage","owner":"ascender1729","description":"CodeSage is an advanced code review assistant designed to enhance the software development process. It provides automated insights, best practice suggestions, and helps maintain code quality across projects.","archived":false,"fork":false,"pushed_at":"2025-12-12T15:25:25.000Z","size":14562,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T16:15:37.094Z","etag":null,"topics":["flask","jinja2","mccabe-complexity","pygithub","python-ast"],"latest_commit_sha":null,"homepage":"https://github.com/ascender1729/CodeSage","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ascender1729.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2024-07-11T17:09:25.000Z","updated_at":"2025-12-12T15:25:29.000Z","dependencies_parsed_at":"2024-07-11T20:05:32.130Z","dependency_job_id":null,"html_url":"https://github.com/ascender1729/CodeSage","commit_stats":null,"previous_names":["ascender1729/codesage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ascender1729/CodeSage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascender1729%2FCodeSage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascender1729%2FCodeSage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascender1729%2FCodeSage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascender1729%2FCodeSage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ascender1729","download_url":"https://codeload.github.com/ascender1729/CodeSage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascender1729%2FCodeSage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32503046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["flask","jinja2","mccabe-complexity","pygithub","python-ast"],"created_at":"2025-02-06T13:30:57.852Z","updated_at":"2026-05-01T15:32:42.264Z","avatar_url":"https://github.com/ascender1729.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeSage\n\nCodeSage is an advanced code review assistant designed to enhance the software development process. It provides automated insights, best practice suggestions, and helps maintain code quality across projects.\n\n## Features\n\n- Function length check\n- Variable naming convention check\n- Import style check\n- Complexity check using McCabe metric\n- Docstring presence check\n- Line length check\n- Class and function naming convention check\n- Test coverage analysis\n- Parallel processing for faster analysis\n- Command-line interface for easy use\n- Web interface for user-friendly interaction\n- Multiple output formats (text, JSON, HTML)\n- Git integration for automated pull request analysis\n\n## Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/ascender1729/CodeSage.git\n   ```\n2. Navigate to the project directory:\n   ```\n   cd CodeSage\n   ```\n 3. Create and activate a virtual environment:\n   ```\n   python -m venv myenv\n   .\\myenv\\Scripts\\Activate.ps1  # On Windows\n   source myenv/bin/activate  # On Unix or MacOS\n   ```\n4. Install the required dependencies:\n   ```\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n### Command-line Usage\n\nYou can run CodeSage from the command line:\n\n```\npython src/main.py [path] [-c CONFIG] [-f {text,json,html}] [-o OUTPUT] [--check-coverage]\n```\n\nArguments:\n- `path`: Path to the file or directory to analyze (required)\n- `-c CONFIG`, `--config CONFIG`: Path to the configuration file (optional, defaults to 'config.yaml')\n- `-f {text,json,html}`, `--format {text,json,html}`: Output format (optional, defaults to 'text')\n- `-o OUTPUT`, `--output OUTPUT`: Output file for JSON or HTML format (optional)\n- `--check-coverage`: Check test coverage (optional)\n\nExamples:\n1. Analyze a single file with text output:\n   ```\n   python src/main.py path/to/your/file.py\n   ```\n2. Analyze an entire directory with JSON output and check test coverage:\n   ```\n   python src/main.py path/to/your/project/ -f json -o report.json --check-coverage\n   ```\n3. Use a custom configuration file and generate an HTML report:\n   ```\n   python src/main.py path/to/your/project/ -c path/to/custom_config.yaml -f html -o report.html\n   ```\n\n### Web Interface Usage\n\nTo run the web interface:\n\n```\npython src/web_interface.py\n```\n\nThen open a web browser and navigate to `http://localhost:5000`.\n\n### Git Integration\n\nTo use CodeSage for automated pull request analysis, you need to set up the following environment variables:\n\n- `REPO_PATH`: Path to the local repository\n- `BASE_BRANCH`: Base branch of the pull request (default is 'main')\n- `HEAD_BRANCH`: Head branch of the pull request\n- `GITHUB_TOKEN`: Your GitHub personal access token\n- `REPO_NAME`: Name of the repository in the format 'owner/repo'\n- `PR_NUMBER`: Number of the pull request\n\nThen run:\n\n```\npython src/git_integration.py\n```\n\nThis will analyze the changes in the pull request and post the results as a comment on the pull request.\n\n## Configuration\n\nYou can modify the `config.yaml` file to adjust the behavior of CodeSage. The default configuration is:\n\n```yaml\nmax_function_length: 20\ncheck_variable_naming: true\ncheck_import_style: true\nmax_complexity: 10\ncheck_docstrings: true\nmin_test_coverage: 80\nmax_line_length: 79\n```\n\n## Running Tests\n\nTo run the unit tests:\n\n```\npython -m unittest discover tests\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\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\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\n\nPavan Kumar - [@the_complex_one](https://x.com/the_complex_one) - pavankumard.pg19.ma@nitp.ac.in\n\nProject Link: [https://github.com/ascender1729/CodeSage](https://github.com/ascender1729/CodeSage)\n\n## Acknowledgements\n\n- [Python AST](https://docs.python.org/3/library/ast.html)\n- [McCabe complexity](https://github.com/PyCQA/mccabe)\n- [Jinja2](https://jinja.palletsprojects.com/)\n- [PyGithub](https://github.com/PyGithub/PyGithub)\n- [Coverage.py](https://coverage.readthedocs.io/)\n- [Flask](https://flask.palletsprojects.com/)\n\n---\n\n## 📖 Citation\n\nIf you use this project in your research or work, please cite it as:\n\n### BibTeX\n```bibtex\n@software{dubasi2024_codesage,\n  author       = {Dubasi, Pavan Kumar},\n  title        = {CodeSage: Advanced Code Review Assistant},\n  year         = {2024},\n  publisher    = {GitHub},\n  url          = {https://github.com/ascender1729/CodeSage}\n}\n```\n\n### APA Format\nDubasi, P. K. (2024). *CodeSage: Advanced Code Review Assistant*. GitHub. https://github.com/ascender1729/CodeSage\n\n### IEEE Format\nP. K. Dubasi, \"CodeSage: Advanced Code Review Assistant,\" GitHub, 2024. [Online]. Available: https://github.com/ascender1729/CodeSage\n\n---\n\n## 👤 Author\n\n**Pavan Kumar Dubasi**  \nPrincipal AI Consultant | VibeTensor\n\n- 🌐 Website: [dubasipavankumar.com](https://dubasipavankumar.com)\n- 💼 LinkedIn: [in/im-pavankumar](https://linkedin.com/in/im-pavankumar)\n- 🐦 Twitter: [@the_complex_one](https://twitter.com/the_complex_one)\n- 📧 Email: pavan.dubasi2024@gmail.com\n- 🆔 ORCID: [0009-0006-1060-4598](https://orcid.org/0009-0006-1060-4598)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascender1729%2Fcodesage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fascender1729%2Fcodesage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascender1729%2Fcodesage/lists"}