Skip to main content

One post tagged with "flutter"

View All Tags

Avoid these common Flutter mistakes with DCM

· 25 min read

We all make mistakes, it's a part of our developer journey. But there are different tools that can help us in our way of creating great software that helps other people. DCM (formerly Dart Code Metrics) is a great example of such a tool. It is a static analysis tool that detects the quality and consistency issues helping you reduce the number of bugs and deliver results faster to your users.

But before we begin, what does static analysis actually mean? Well, static analysis is the automated analysis of source code without executing the application. It does not know anything about how the code will be run, what actual data it will work with, etc. A good example of such tools is the Dart analyzer (you probably have it running right now, even if you are no aware of it) and any tool that is a linter.

How does it work? It would take a book (or maybe even two) to describe it in details, but in short, it runs a separate process that is able to parse your code into set of tokens, build AST and validate it based on some rules.

And yes, dynamic analysis also exists 🙂.

Let's take a look at the various problems that you might encounter in your code and how DCM can help you find them together.