https://github.com/hwvs/gptcodequalitysharp
GPTCodeQualitySharp is a C#/.NET code quality assessment lib/tool that leverages OpenAI or compatible text-completion models to analyze and score source code based on multiple conventions. It uses multiple pass-throughs to accurately identify areas with poor code quality. The project includes a demo application and is a work-in-progress.
https://github.com/hwvs/gptcodequalitysharp
code-analysis-tool csharp csharp-library dotnet dotnet-framework gpt-3 gpt-4 gpt3 gpt4 json linter openai quality-assurance utility
Last synced: 8 months ago
JSON representation
GPTCodeQualitySharp is a C#/.NET code quality assessment lib/tool that leverages OpenAI or compatible text-completion models to analyze and score source code based on multiple conventions. It uses multiple pass-throughs to accurately identify areas with poor code quality. The project includes a demo application and is a work-in-progress.
- Host: GitHub
- URL: https://github.com/hwvs/gptcodequalitysharp
- Owner: hwvs
- License: mpl-2.0
- Created: 2023-06-02T21:05:50.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T20:38:17.000Z (over 2 years ago)
- Last Synced: 2025-04-05T02:21:39.988Z (12 months ago)
- Topics: code-analysis-tool, csharp, csharp-library, dotnet, dotnet-framework, gpt-3, gpt-4, gpt3, gpt4, json, linter, openai, quality-assurance, utility
- Language: C#
- Homepage:
- Size: 66.4 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPTCodeQualitySharp (*-alpha_WiP_version*)
[](https://github.com/hwvs/GPTCodeQualitySharp/actions/workflows/dotnet.yml)
__GPTCodeQualitySharp__ is a __*language-agnostic code quality assessment tool*__ that utilizes OpenAI GPT (**default=`GPT-3.5-Turbo`**, *TODO: GPT4*) or compatible text-completion models to analyze and score source code based on multiple conventions, via a large prompt.
This project aims to help developers pin-point areas with poor code quality and improve their projects.
Code is split into workable (truncated) chunks, and analyzed chunk-by-chunk - multiple pass-throughs using different chunk sizes (non-factors of each other) can allow the differential, or average, to be used to identify the precise areas, which avoids prompting for exact lines to flag.
⚠️ __It is a work-in-progress__ and will be refactored for better performance and usability. All Classes are subject to future changes.
*(This is only on GitHub to get it out to the public faster, it's not final)*
## Credits
#### **Original Author**: [Hunter Watson](https://github.com/hwvs)
#### **Original Repo**: https://github.com/hwvs/GPTCodeQualitySharp
#### **Code License**: Mozilla Public License 2.0
## Contributions / Improvements
#### 🏆 If you make any positive changes, please [submit a pull request](https://github.com/hwvs/GPTCodeQualitySharp/pulls)!
---
## 💡 Tested Languages (Target-Language Analyzed)
- C#/.NET (CSharp) **`High Accuracy`**
- PHP **`High Accuracy`**
- Ruby **`High Accuracy`**
- PowerShell **`High Accuracy`**
- JavaScript **`Moderate Accuracy`**
- VB.NET **`Moderate Accuracy`**
- HTML/CSS **`Low Accuracy`**
*(Disclaimer: Accuracy is fairly subjective, and is compared to my own human opinion. Good code was tested from popular and well-engineered GitHub repositories. Bad code came from random searches for bad code, some of my own code, and by modifying some of the good code to add code-smells such as long chains of useless if-statements. )*
## Screenshot of Demo App

## Features
- Analyzes source code files and scores them based on multiple conventions
- Stores API calls in an SQLite database to prevent duplicate calls
- Uses multiple pass-throughs of the code to accurately pinpoint poor areas
- Includes a demo application to showcase the API
## (TODO) Future Improvements:
- Improve the scoring algorithm for better accuracy
- Refactor the codebase, using itself to see how it performs and to fine-tune the prompt
- Add more prompts