my project is having total 42 code smells out of which 1 is “new code smell in past 30 days”.
Looking for correct endpoint/way to get this “1” in API response, so that -
“CODE_SMELL” measure gives 42.
“NEW_CODE_SMELL” measure gives 1.
But, Using measure as “code_smell” or “new code_smell” are yielding same output.
Please advise right way to fetch ONLY new code smell
Have you tried this via the UI? The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.
Hello Ann, thanks for your kind words.
I tried to hit same API vis UI as well , new_code_smell is still giving all code smells count.
As I am trying to find some solution though, would be of great help if you also try to hit new_code_smell measure at your side , would be of grateful.
Thanks & regards,
Abhinav
Hello Ann,
Really thank you so much for the hint. I went through above shared link and was able to identify the endpoint being hit for “new code smell”. It’s calling : SonarHost/api/measures/component?additionalFields=metrics&component=ProjectKey&metricKeys=new_code_smells
[link : this guide → How to reverse engineer the Sonar Web API]
basically with this anyone can reverse engineer and identify which endpoint is being hit for particular action.
You Rock!!!