CodeSense is a VS Code extension that analyzes code quality using a hybrid approach of linters and LLM-based analysis. It evaluates code for structural integrity, variable naming conventions and logical consistency. CodeSense also provides actionable insights and fixes to improve code maintainability and productivity.
Ensure the following are installed on your machine:
- Node.js (v18+ recommended)
- Python (v3.10+ recommended)
- VS Code
- Ollama (for running CodeLlama locally)
-
Clone the repository:
git clone https://github.com/Rayyanahmed2412/CodeSense.git cd CodeSense -
Install dependencies:
npm install
-
Set up the Python environment:
Ensure
pylintis installed:python -m venv venv venv\Scripts\activate pip install pylint
-
Install and set up Ollama:
Download and configure Ollama, and ensure the CodeLlama 7B model is available.
ollama run codellama:7b
-
Open the project in VS Code:
code . -
Open the extension.js file
-
Click F5 to open the [Extension Development Host]
-
Start analyzing code:
- Open any code file.
- On save (
Ctrl+S), PyLint runs and displays diagnostics. - Open Command Palette (
Ctrl+Shift+P) and run the command "CodeSense: Generate Fixed Code"
Contributions are welcome! If you'd like to improve CodeSense:
- Fork the repository.
- Create a feature branch.
- Submit a pull request with a clear description.
- Support for additional linters (e.g., ESLint, MyPy).
- Deeper integration with LLM for enhanced fix generation.
- Improved performance optimization for large codebases.
Feel free to open an issue for bugs, suggestions, or questions.