We have students submit exercises in a course while they have to adhere to some code conventions. For example, functions names should be in camelCase. Function length should not exceed 50 lines (The tasks are simple enough to divide) etc. I'm looking for a tool that can automatically check that for C/C++ (Both are needed). That is, I would like the tool to complain when something is wrong so the student can fix it. So far I've been unable to find something that fits well. If the thing is open source and can be easily configured to our needs that will be o.k.
As the organization moves to an agile software development process that values the use of automation, an automated static analysis tool for C++ is necessary to identify standards violations.
CppDepend is a commercial static code analysis tool for C++. It can complement other static code analysis tools quite easily as it focuses on analyzing and visualizing the code base architecture (for example, whether it is layered correctly, dependencies-wise), rather than on revealing errors.
#1) PVS-Studio. Best for not only for finding typos, dead code, but also potential vulnerabilities. A SAST solution that supports integration into popular IDEs CI/CD and other platforms. PVS-Studio is a static code analyzer that detects errors in C, C++, C#, and Java code.
You can use the unix tool indent
to force some C coding style.
See
man 1 indent
when it is installed.
QA-CPP might help here. It's been over a year since I used it but you can configure it to do that sort of thing.
You might want to give the guys at Programming Research a call and check if you can do that.
However the question remains why? If my lecturer started berating me for code style over functionality I would think he had a screw loose. As someone one who has gone through the University system you should be preparing them for working in the real world - heaven knows the stuff I see coming through now leave a lot to be desired.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With