Do a vault wide search and display all the files that have exact same names.
Maybe generate a result .md file.
(Searching for same aliases could be an optional function)
Case scenario
This is mainly for debugging, as sync service bugs often produce duplicates, leading to tedious work merging them back.
Could also be useful when I forgot about an old file and created a new one with the same name unknowingly.
Just an observation, but you probably would want to compare based on some hash of the files versus just using the file name if you’re looking for true duplicates.
It works for me.
Of course I had to activate ‘enable dataview JavaScript queries’ and ‘enable dataview JavaScript inline queries’ settings on Dataview plugin as it was asked the first time I run that script.