I find, when I'm reviewing VBA code, that most of the bugs are easily classified errors, such as typos, not setting things to Nothing
, not closing DB connections, etc.
I know that using "Option Explicit" can solve some of these, but I'd rather use something more powerful.
Are there any static analysis tools for VBA?
Static code analysis advantages:It can find weaknesses in the code at the exact location. It can be conducted by trained software assurance developers who fully understand the code. It allows a quicker turn around for fixes. It is relatively fast if automated tools are used.
Static analysis is used in software engineering by software development and quality assurance teams. Automated tools can assist programmers and developers in carrying out static analysis. The software will scan all code in a project to check for vulnerabilities while validating the code.
Static analysis tools provide a means for analyzing code without having to run the code, helping ensure higher quality software throughout the development process.
Static code analysis is performed early in development, before software testing begins. For organizations practicing DevOps, static code analysis takes place during the “Create” phase. Static code analysis also supports DevOps by creating an automated feedback loop.
You can perhaps start by using MZ-Tools. While it does not have much in the realm of static analysis features, it is free and does provide some help in managing and editing your code base.
One feature it has that does perform a form of static analysis is:
Project Analyzer: VBA Plug v3
MZ Tools
VBA Code Profiler *
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