PR comments are automatically deleted ,but it is showing in the portal

PR comments are automatically deleted once we fix the issue and run the analysis,but still few issues are showing in the portal, they will reappear In the PR comments for the next run

Hey there.

I’m not sure I fully understand – do the issues still exist in your code, and are raised on SonarQube?

Also, as noted in the template post, please provide information like the version of SonarQube you’re using.

Feel free to share some screenshots as well if it helps to demonstrate the issue.

Hi @Colin
Thanks for the reply.

We are faced with 2 issues .that are as below

  1. we found a few codes smell comments on the PR since we use PR decoration. and we fixed the code smells and rerun the pipeline .then the code smells comments are deleted automatically .but two code smells are still present at the portal .but not present on the PR comments .and again we ran the pipeline, those two missed code smells appeared in the PR comments again .problem statement is, the developer may commit to default branch in this interval since PR comments are deleted [but still exists on the portal] and may not break the quality gate.
  2. Code Smell (critical): Refactor this method to reduce its Cognitive Complexity from 36 to the 15 allowed.
    Code Smell (major): Constructor has 9 parameters, which is greater than the 7 authorized.
    what are the best practices for these thresholds given?

Hey there.

Let’s go step by step. Can you come back to the two other questions I asked in my last response?

Hi @Colin

We are using Sonarqube 9.9 version
Question 1) screenshots are not taken
Question 2) Can you please provide the best practices for the code smells detected.what is the minimum threshold we need to maintain
Code Smell (critical): Refactor this method to reduce its Cognitive Complexity from 36 to the 15 allowed.
Code Smell (major): Constructor has 9 parameters, which is greater than the 7 authorized.

Hey there.

I think it’s really important to provide what you’re seeing – a screenshot of two issues existing in the context of a Pull Request Analysis (not on the main branch) that aren’t visible on the Pull Request in Azure DevOps.

Hi @Colin
Is there any way to disable code smells on the PR [which is referring from PR decoration]

Hi @Colin ,can we connect for better understanding

Hi, @Colin we would like to have a few questions and best practices.can we connect over teams for 30mins or 1hr

Hey there.

This is a Community forum, we don’t hop on calls.

You can turn off Code Smells in your Quality Profile, which will prevent them from being decorated on the PR. Why do you want to turn off code smells?

Hi @Colin do we have any best practices for the below mentioned thresholds

Hey there.

I offered a response and asked a question! This is a discussion forum. Please show some courtesy and participate in the discussion.

You may want to review our FAQ:

https://community.sonarsource.com/faq