McCabe complexity for just changed files in a commit?

Kushal Kumaran kushal at
Tue Oct 5 00:36:53 EDT 2021

On Sat, Oct 02 2021 at 09:05:47 PM, Dan Stromberg <drsalists at> wrote:
> Hi folks.
> Is there a way of getting the McCabe Complexity of just the functions and
> methods (in Python) changed in a git commit?
> I found radon, and it looks good.  But I think it wants to do entire files,
> no?

Calculate your metric for this commit, calculate metric for parent
commit, and take the difference?  That's how we do coverage metrics to
report stuff like "change increases/decreases coverage by N%".


More information about the Python-list mailing list