REST API for Code Inspections / Duplicates
We have set up 2 TeamCity build configurations:
1. One configuration runs code inspections using the runner type 'Inspections (IntelliJ IDEA)'
2. Another configuration runs code duplicates finder using the runner type 'Duplicates finder (Java)'
For each of the builds, we can see the respective 'Code Inspection' and 'Duplicates' tab. However, if I query the build output using REST API (eg. http://<hostname>:8111/httpAuth/app/rest/builds/id:6), I do not see the anything in the JSON output for either code inspection or duplicates.
Is the inspections and duplicates data available via REST API?
Is there any way other than REST API that we can obtain this data?
Please sign in to leave a comment.
There is no dedicated REST API to get inspections/duplicates report details, only the general statistics can be retrieved via build statics values.
If you need detailed reports, the way to go seems to grab the raw report data generated by IntelliJ IDEA on the agent and use that for analysis. For inspections that can be done using artifacts publishing rule like: %system.teamcity.build.tempDir%/inspection*/**/* => inspection_results.zip
Could you please share why do you need the detailed report? How do you plan to use it?
Thanks for the reply. We would like to collect stats for builds over time to analyze the trends within the code inspections (eg. see whether the error counts or duplicate counts are getting better or worse over time).
I see that at least the summary stats for a particular build are available in the statistics REST output for both Duplicates and Code Inspections.
REST API: http://<hostname>:8111/httpAuth/app/rest/builds/id:6/statistics
Right, the summary numbers (displayed on the Parameters/Reported statistic values or in the dedicated section in Overview on the build results) is available via REST as these is part of the build statistic values.