Cyclomatic Complexity Of Last Code Commit

Does upsource identify the Cyclomatic Complexity of the last java code commit based on the modified methods/new classes etc?

Since upsource currently does not provide a pre-commit review support, with a rest service as explained above we could identify the trend of how many reviews are skipped by developers even when the code was complex.

Kindly let me know your inputs. Thanks!

Vladimir Kovalenko
Comment actions Permalink

Hi Amit,

sorry for the delayed response.

No, unfortunately, as of now Upsource does not calculate any metrics of code with every change.

Still it is generally possible to implement such an analysis using Upsource API by retrieving file contents and calculating metrics with some other tool, but it looks as a rather complicated solution.

Comment actions Permalink

Thanks Vladimir for the reply.

Ok. So basically I would have to calculate the complexity of a file upfront and persist it. Later on a code commit I would re-calculate it and compare it to determine if the new code change added more complexity.

This sounds like an approach just that persisting these code complexity metrics external to upsource sounds a lot of extra work the program would need to do. Any suggestions?


Please sign in to leave a comment.