Questions tagged [quality-gate]
30 questions
0
votes
1 answer
Use output of a CURL and fail if the output contains ERROR
I am using this below CURL statement:
curl -u $SONAR_TOKEN: https://$SONAR_SERVER/api/qualitygates/project_status?projectKey=$SONAR_PROJECT_KEY\&pullRequest=$SONAR_PR_KEY
Output:
Using IF statement to pass/fail the above scenario.
if […

Santosh Kumar
- 53
- 1
- 10
0
votes
1 answer
Bash IF condition with multiple conditions not giving proper result
Trying to fetch the status of the URL for sonarqube quality gate and check if the status is "OK" the condition should pass or if the status is "ERROR" then it should fail.
quality_gatesstatus=$(curl -u…

Santosh Kumar
- 53
- 1
- 10
0
votes
0 answers
Invoke-RestMethod : {"errors":[{"msg":"Either \u0027analysisId\u0027, \u0027projectId\u0027 or \u0027projectKey\u0027 must be provided"}]}
I am trying to get quality gate status from sonar server using API by passing pull request ID but I am getting error:
$QualityGateResult = Invoke-RestMethod -Method Get -Uri…

Santosh Kumar
- 53
- 1
- 10
0
votes
0 answers
sonar quality gate in azure pipelines for .net projects
We have set up sonar quality gate in our azure pipelines by using api key and using project_key as a paramater to fetch the quality gate status.
quality_gatesstatus=$(curl -u $sonar_token:…

Santosh Kumar
- 53
- 1
- 10
0
votes
1 answer
Apply a quality gate to only one of the tools
I have a series of jenkins pipeline jobs which build bitbucket pull requests.
Those pipelines have a Quality stage, which records issues using warningsng for GCC warnings and Coverity defects (via the generic issues tool).
The relevant part of my…

ncarrier
- 433
- 3
- 14
0
votes
1 answer
sonar QualityGate Should be Checked before SVN Commit-- How to achive this?
QualityGate Should be Checked before SVN Commit
I have to check sonar quality gate before SVN commit,
Quality gate should check before code commit into SVN repository only,
Can you suugest any suitable aproach.

Pradeep
- 1
- 1
0
votes
1 answer
Quality Gate does not fail when conditions for success are not met
I have established Quality Gate for my Jenkins project via SonarQube. One of my projects have no tests at all, so in the analysis I see that the code coverage is 0%. By the quality gate rules (<60% coverage = fail) my pipeline should return an…

Joe
- 337
- 6
- 21
0
votes
0 answers
How to fix CVE-2020-7663 | CVSS Score: 7.5 vulnerability
I generate a new angular application. After commiting the code, SnarQube analysis indicates that quality gate is failed, because :
websocket-extensions:0.1.4 | Reference: CVE-2020-7663 | CVSS Score: 7.5 .
I read this post of : James Coglan, fix…

nai
- 51
- 1
- 3
0
votes
0 answers
SonarQube plugin to modify evaluation of existing code coverage
I'm looking to create a plugin to prevent analysis failing if the the coverage level is within X percent of the current quality gate value. I'm not too sure where to begin or how to approach solving this problem. I've looked at the Web API to attain…

JAM
- 1
- 1
- 1
0
votes
1 answer
Sonar Qality gates and email Jenkins Pipeline
As I want to configure that if my Quality Gate of Sonar Qube gives status error, it should not allow any thing in the body but Send email from Email Ext in Jenkins Pipeline.
stage("Quality Gate"){
steps{
script{
…
0
votes
1 answer
Sonar Quality Gates Plugin throwing numberFormatException
following the set up as provided in https://github.com/jenkinsci/sonar-quality-gates-plugin , while adding the post-build-step with the project key, I am facing the following error:
> java.lang.NumberFormatException:For input string:…

Sreelakshmy Koonath
- 31
- 3
0
votes
1 answer
Updating project status under a change in quality gate
I recently used sonarqube api to create a dynamic quality gate, it increases or decreases the acceptable number for the project, according to the number of lines of code, but I'm having some problems ...
It works like this, after the analysis I use…

Bruno Henrique
- 25
- 1
- 5
0
votes
1 answer
SonarQube fails on comment % while calculated ratio is >26%
I have been using sonar for over 4 years for Java projects we have created.
Currently, we want to fail the build if some metrics cannot be met. Thus, I installed Build Breaker plugin and re-run the build cycle, without any issue. Then I modified…

öncül korkut
- 13
- 3
-1
votes
0 answers
How to set quality gate for specific project in github actions
Hi I have multiple projects in my repository. I am trying to set quality gate for one project in my repository. I have below code for this.
SonarQube_API:
runs-on: windows-latest
permissions:
contents: read
packages: write
…

Niranjan
- 63
- 5
-3
votes
1 answer
Sonarqube Refactor the below code to reduce its cognitive complexity. Complexity is 33, we should reduce to 15
As the below code is having nested if conditions, sonarcube complexity is increasing.
Need to reduce the cognitive complexity from 33 to 15 allowed.
I have tried placing only one try block and one catch block but I didn't work as much as I…

A R
- 1
- 1