msbuild.exe commandline can be useful to enable Code Analysis and log the output of visual studio solutions or project files.
Rule set for the code analysis will be same as what developer has set with his proj file/ solution.
eg:
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "\SolutionFile.sln" /P:RunCodeAnalysisOnce=True /t:rebuild /verbosity:quiet /logger:FileLogger,Microsoft.Build.Engine;logfile="\DebuggedOutPut.log"
The Log file will give detail information about the CA errors with details and details on Errors and other warnings from Solution file.