Duplicate code to search only on the same module


Is there a way to make the duplicate code locator to search for duplicates only on the same module, and not the entire project?




Yes, you can use Custom scope option with the selected module.


Hi Serge,

Is there a way to set automatic one (as seen in the screenshot below) to look only in the current module ?


You can make this inspection active only for the specified scope, see https://www.jetbrains.com/idea/help/changing-the-order-of-scopes.html.


Is there a way to make it to look only in the current module (the module the file I am editing belongs to)? I have looked through all predefined scopes - and I could not find something like that.

I also tried to create a custom scope - but could not find a modifier that be something like "only current module" in https://www.jetbrains.com/idea/help/scopes.html.

Creating a different scope for each module will not work, since it will be essentially the same as All Project (It will look in all of the modules..)




It's not possible to make it work for the current module since inspections do not have the context of what is current. You can make it work for some specific module only.


I think this is quite essential. I have some generated code in multiple microservices, and this inspection is incorrectly warning me about duplicates. I want the inspection to never exceed module boundaries, regardless of what is "current".


+1 for having a switch: "search for duplicates only in this module"!


+1. Was this taken into account ?


Please sign in to leave a comment.