microsoft / infersharp

Infer# is an interprocedural and scalable static code analyzer for C#. Via the capabilities of Facebook's Infer, this tool detects null dereferences, resource leaks, and thread-safety violations. It also performs taint flow tracking to detect critical security vulnerabilities like SQL injections.
MIT License
735 stars 29 forks source link

Multiple root folders #205

Open FixRM opened 1 year ago

FixRM commented 1 year ago

Hello! Thank you for the great tool. Is there built in way to scan several "root" folders for the same solution. We have solution that consists of several libraries that designed to be executed as "plugins" by external host app, so there is no single composition root for that project. Another use case - are unit test projects. Of course, we are not going to ship their code but it is good to know if we have issues there.

I guess I can use the following https://github.com/microsoft/infersharp/blob/main/RUNNING_INFERSHARP_ON_WINDOWS.md to achieve my goal, but this requires some tricky path translations in case if I want it to run on any user machine.

xinshiMSFT commented 1 year ago

Hi, I think the quickest mitigation is to modify the execution script yourself. Basically the script copies all the .dll and .pdb files from an input path into a staging folder like this. You can modify it to allow multiple input paths and iterate through them with the same logic.

FixRM commented 1 year ago

I thought it sits inside WSL container and will be rewritten with next release?

xinshiMSFT commented 1 year ago

Yes, this is just a mitigation for you before our next release. You can modify the script in your WSL instance in the meantime. I will mark this as a feature request.

FixRM commented 1 year ago

Thank you