How to find duplicate dependencies in large projects

So I work for a large company with a HUGE app that includes dozens of modules and really long build.gradle files. I’m wondering if there is a gradle task that will scan the gradle files and let me know which dependencies have been declared more than once?

For example on line 448 of the build.gradle file:

//more dependencies here
448 - implementation “com.squareup:otto:$ottoVersion”
// more dependencies here

and then again on line 697:

// more dependencies here
697 implementation “com.squareup:otto:$ottoVersion” // duplicate dependency
// more dependencies here

I used the dependencies task but it did not output any information on duplicate dependencies.