Report of '0 references' on public functions

I've been steered to trial ReSharper in order to evaluate and report on ‘0 references’ of an existing software suite. What I'm seeking (and have not found so far) is a means of reporting on all unused API endpoints. The simplest approach would be obtain a report of ‘unused code' that includes public classes, but I can't seem to find how to produce this report (I only get private functions that are ‘unused’).

Ultimately, I would like to be able to evaluate the multiple C# solutions (6 discrete compiled components) that comprise our software suite to determine which APIs are never called by other components. It would be ideal to be able to combine the analysis of all these components to determine the truth of which API endpoints are truly unused. Does anyone have any suggestions of any options to achieve this outcome?

0
1 comment

You can use Find Code Issues feature to create such report.

If I recall correctly, unused public classes will be reported as unused only if Solution wide analysis is enabled.

Also, you can automate creating this reports in SARIF format (machine readable) using ReSharper command line tools

Unfortunately, these analyses won't be able to include data from different solutions, we always work in the context of the single solution. However, you can try to create a large solution including all your sub-solutions using the `dotnet new sln` command line tool. See https://stackoverflow.com/a/53723577 

0

Please sign in to leave a comment.