Analyse cognitive complexity of pull request


my team and I are currently looking for a way to enforce “small” pull requests. Because I don’t want to just check the number of changed lines I was wondering if there is a way to use SonarQube to analyse the cognitive complexity of new code. I know that we can check if a function exceeds a certain limit, but I want to have this measure on a pull request level. My general goal is to check the amount of new code but also take into account the complexity of the new code (e.g. ignore comments)

Maybe someone has an idea or uses something similar?

Best, Lorenz :slight_smile:

Hi Lorenz,

Welcome to the community!

You haven’t been getting a response on this because the functionality doesn’t exist & I guess no one (myself included) has any ideas in this direction.