Python typing analysis

Is there a way to perform typing analysis of a python codebase using SonarQube?
I’ve found a post of more than 3 years ago about mypy integration but with no updates.
It would be good to get also static type checking using SonarQube.

Thanks.

Hello,

Sorry for the late answer, and thank you for bringing this up, as I think it’s a quite important topic.

It is still not possible to import mypy reports to SonarQube directly. I created a ticket for that, as I believe it makes a lot of sense, given that mypy is a staple in any development workflow that relies on typing.

That being said, as was mentioned in the thread you linked, we want the out-of-the-box experience when using our products to be as good as possible. Since this thread was made, we developed a type inference engine in our Python analyzer and implemented quite a few rules that relate to type checking.

If there is anything you think the Python analyzer doesn’t do properly, I’d love to have more details so that we can improve our engine.