I’ve finished a small project that is rather non-standard for me: it has just a few hundred lines of logic written by me, and most of the code is rather banal functions I picked up from the different articles and doc sheets (you know, those functions that are quite “atomic” like “check if the process is running” or “get the process name by pid by reading /proc dir” or “get a mount point by a filename”)
The code was written in a “ok, let’s experiment if I can do this” approach, so now it is in a complete mess.
So the question is if is there some AI that can do an initial code review for me? I’ve tried GhatGPT, but it was completely banal and useless.
ChatGPT can do better if you explicitly say what you want. All it can do is suggest areas to look at.
Try something like:
Analyze the following code and provide direct feedback with a focus on maintainability, established best practices, and robustness. Respond as a seasoned expert providing actionable criticism, avoiding praise and low-impact suggestions. --- <code>
That being said, you have to look at the stuff it says and consider whether the feedback is useful or not. It suggests some things to examine, but that doesn’t mean the advice it gives is always good. You can also feed it a chunk of code and ask if there is a more efficient or maintainable way of writing it — but remember it’s always going to say there are things you can improve so you have to be the one to decide which suggestions make things actually better and which are just response filler.
It also may not catch everything, particularly if it doesn’t understand where the code will run or what it will be used for.