Questions tagged [sonarcloud]
SonarCloud is the code quality cloud service provided by SonarSource.
195
questions
0
votes
0
answers
11
views
Dotnet Sonarcloud end failed
I trying to integrate my Solution based on .net6 with SonarCloud and Github actions.The problem is that the action build failed on the sonar scanner end.I tried to change working dirs but with the ...
0
votes
1
answer
22
views
List of users in private SonarCloud Organization
I am attempting to use the SonarCloud API to automatically give me a list of all users in my organization. Eventually I would like to automate it in an AzureDevOps Pipeline, so getting the list of ...
1
vote
0
answers
33
views
sonarcloud isn’t scanning my entire project
I am integrating SonarCloud with GitHub actions for Objective-c repos. It is working now when I change something in the repo but it only sees the code that changed recently. Is there any way that I ...
0
votes
1
answer
27
views
SonarCloud Could not import unit test report TRX Unrecognized root element <TestRun>
I'm new to testing and i'm trying to run my unit tests and coverage for .NET in Azure Pipelines and send it to SonarCloud.
When i run my unit tests using VSTest I get the TRX file, and .coverage file. ...
0
votes
1
answer
42
views
Android Gradle - SonarCloud Integration with Jacoco Plugin, coverage is always 0.0%
I am trying to sync my locally generated Coverage Report from Jacoco to SonarCloud, even though there are no errors, the Coverage is always 0.0%. I am able to generate a JacocTestReport.xml with an ...
0
votes
0
answers
68
views
SonarCloud New Code and Code Coverage Setup for Spring Boot
I am trying to perform analysis on the new code however the sonarCloud seems to analyze everything. I am not sure what's missing.
I am using 2 Github workflows, one during pull request
name: ...
0
votes
0
answers
40
views
Configuring Spring Boot project with multiple Maven modules
I have a web project with following structure:
app
pom.xml
–modules:
app-api (contains only OpenAPI documentation used to generate REST endpoints)
pom.xml
app-service (contains the actual business ...
0
votes
1
answer
10
views
Sonar Cloud - Exclude Selenium from Sonar
I am running a azure devops pipeline with sonar cloud and I wanted to exclude selenium folder from sonar cloud with following:
sonar.exclusions=NWP.Selenium/**
And it did this
It was not included in ...
1
vote
1
answer
101
views
How to set up a monorepo in SonarCloud with a Java + Angular application
I have developed an application where the backend is developed using Java language (with maven) and the frontend is using Angular language. I host both parts in one project in github.
Now I am ...
0
votes
0
answers
10
views
Detect use of listed words
Is there a way to have SonarCloud check if your code contains listed words?
I have two solutions - let's call them Monkey and BananaTree. The Monkey solution needs to know about BananaTree because ...
0
votes
0
answers
50
views
Reports not getting uploaded on SonarCloud after Analysis, Throws Project not found
I'm trying to setup SonarCloud on my Azure Pipelines. I have added sonar-project.properties file in the root of my repository which contains the below parameters:
sonar.projectKey=xxxx_xxxxxxxxx
sonar....
0
votes
1
answer
91
views
How to avoid to execute a task in Yaml template in Azure [duplicate]
I have a generic yaml template which is commonly used for many tasks in Azure, and we have some tasks related to sonarcloud and that is not required for few pipelines. And we are not supposed to ...
0
votes
0
answers
26
views
Skip sonarcloud from Maven goals command
I am using Azure Devops Yaml pipeline and we have a template used for many tasks and out of which we have a Sonarcloud task which does not need to be executed for our scenario, since that is a generic ...
0
votes
0
answers
143
views
Error SonarCloud : "This class has 6 parents which is greater than 5 authorized."
My test in sonarcloud reports this error that I have never found anywhere.
public class PngjPrematureEnding extends PngjInputException {
public PngjPrematureEnding(String message) {
...
3
votes
0
answers
493
views
SonarCloud project not found by Maven plugin for Azure Devops Pipelines
I am compiling a Maven project with Azure Devops Pipelines. Following is the relevant code (don't mind indentation, it's in an if branch).
I had successfully run earlier analyses on the main branch, ...
-2
votes
1
answer
164
views
Gitlabci pipline failes with: syntax error in rules in gitlab-ci.yml
In the below gitlab-ci.yml I am getting a syntax error when I start a pipeline. The rules are the same in other branches and the validation and other pipeline jobs run fine.
Syntax is incorrect. CI ...
0
votes
0
answers
50
views
Convert cobertura-coverage.xml to sonar analyze
I am coding in vuejs and using cobertura to check the coverage
When i run tests "test": "NODE_ENV=test jest --reporters=jest-junit --reporters=default --coverage" from package.json,...
0
votes
0
answers
112
views
How do I make SonarCloud read a local JaCoCo report?
I need to make SonarCloud import a coverage report made by JaCoCo during the build in the CI pipeline.
The coverage is done on java binaries (jar file) not on plain source files.
In the pom.xml I've ...
0
votes
0
answers
27
views
Sonar cloud UnCoverage Lines is difference compare with code
When I fix coverage in sonar cloud
the report say that UnCoverage Lines is 1
But I saw red warning in code is so many
How can I config "UnCoverage Lines" it count number of line uncoveraged ...
0
votes
0
answers
38
views
SonarLint - Sync pull request "quality gate" results with SonarLint in Visual Studio 2022
Following this illustration, it should be possible to send results of pull requests back to the IDE (Visual Studio 2022 with SonarLint) using SonarQube. Is there a similar option for SonarCloud.io? I ...
0
votes
0
answers
74
views
Reduce duplicated blocks in a React project
I'm optimizing my React project according to Sonarcloud results. It's in a pretty good state, however I'm getting a high duplication score (20.5%). When I examine it, I see that there are indeed ...
0
votes
0
answers
160
views
Disable pull request analysis for sonarcloud.io when SonarCloud Automatic Analysis is used
Is there a way to disable pull request analysis for sonarcloud.io when SonarCloud Automatic Analysis is used for a Github repository?
I need the long-lived branches analysis only, but I get all team ...
0
votes
0
answers
127
views
sonarcloud dont check duplication javascript
I've been looking for hours how to disable sonarcloud checking on duplicate lines/blocks in my sonar-project.properties file, and I still can't make it, it's driving me crazy.
I've tried
sonar.cpd....
2
votes
0
answers
1k
views
Change main branch in Sonarqube without deleting branch
I am trying to change my main branch in Sonarqube from master to mainline as I have been doing my analysis on mainline for the past few months.
This post below in the Sonar community says that I have ...
1
vote
2
answers
225
views
Sonarcloud: Unexpected unknown at-rule "@tailwind"
Sonarcloud is reporting a bug in my Vue 3 application due to the Tailwind settings, however it is as in the documentation.
What is the best alternative in this case?
1
vote
1
answer
715
views
SonarCloud Code Coverage always coming as 0 - GitHub Actions dotnet Core
I am trying to get the Code Analysis done with SonarCloud using the Github actions for my .NET Core application. I have added the below code in my build.yml file for .NET Core Build & Test to ...
0
votes
0
answers
49
views
How to export the rules from the Sonarcloud.io to local setup?
I am trying to find a way to get a list of rules from SonarCloud Java (or whatever) rules (with keys, description, etc.) and export it as an Excel, CSV or XML.
Does anyone know how to do this?
Any ...
0
votes
0
answers
45
views
./gradlew: No such file or directory
I'm configuring sonarCloud through githube actions and it returns an error in the build.
I'm using monorepo
I believe I need to indicate the path of gradlew
I already tried to change the env path -&...
0
votes
0
answers
59
views
SonarCloud can't clone private submodules in GitHub workflow
I am running a SonarCloud Scan on a private GitHub repo which contains private submodules from the same organization
My workflow file /.github/workflows/build.yml is:
jobs:
build:
name: Build
...
1
vote
0
answers
83
views
SonarLint plugin misses some (SonarCloud's) rules locally
TL;DR -> Force code smells to apear as SonarCloud issues on IDE
I got SonarLint plugin (vscode) installed locally and configured with external SonarCloud rules (by my organization's project).
The ...
1
vote
0
answers
236
views
Configure sonar.issue.ignore.multicriteria for multiple paths
I want to disable a SonarQube rule for multiple files at different paths. Also I want to make this configuration within the pom.xml and to through the Sonar UI.
I couldn't find any clue on how to do ...
0
votes
0
answers
95
views
Sonar Test report [report refers to a file which is not configured as a test file]
I have a project that uses React, TS, jest, and Testing-library with the following structure:
root/
|sonar-project.properties
|scheduler/
|src/
|components
|...
|package.json
...
1
vote
1
answer
827
views
Loop should be simplified by calling Select - sonar cloud error c#
I get SonarCloud error in this code:
foreach (var item in itemList)
{
if (string.IsNullOrEmpty(item.Name))
{
throw new BadRequestException("Item name is null or missing...");
...
0
votes
0
answers
166
views
Azure Devops pipeline not publishing code coverage results in Sonarcloud
We have a Maven project and it will be executed in Azure Devops pipeline. Recently we configured Sonarcloud for Analysis and Code coverage, and the Analysis is happening and code coverage always shows ...
0
votes
1
answer
703
views
Error Integration Bitbucket Pipeline and SonarCloud
ALM used Bitbucket Cloud
CI system used Bitbucket Cloud
Languages of the repository: Angular (Other (for JS, TS, Go, Python, PHP, …))
Error observed
ERROR: Error during SonarScanner execution
ERROR: ...
0
votes
0
answers
7
views
Environment variables SonarCloud
I tried to analyze a Github project with Sonar Cloud. When I tried to launch the command with maven, this error comes out:
You're not authorized to run analysis. No sonar.login or SONAR_TOKEN env ...
0
votes
0
answers
23
views
SonarCloud is asking to initialize a variable which is already declared
There is a variable used in a function but declared outside it and is available globally.
Sonar cloud is suggesting to initialize it
but the variable is already declared in another file ...cobrowse....
-1
votes
1
answer
58
views
How to fix this sonarqube blocker without affecting to the logic
Could you please look at below image and please let me know the solution for this. I have tried to write a try-with-reources for Statement and Resultset but inside try block what should I write
enter ...
0
votes
0
answers
59
views
Generate sonarcloud report with Jest
Is there anyway to generate a sonarcloud report with Node.js using jest? I've found the plugin jest-sonarcloud-reporter, but only runs it locally and generates de .xml, and I need to upload de report ...
0
votes
0
answers
27
views
How an individual developers can open the SonarCloud report without using the admin credential
In Azure DevOps when a SonarCloud scan is completed, it can be viewed through “Detailed SonarCloud report” hyperlink inside Extensions tab to those who have admin access.
I want my developers to ...
1
vote
0
answers
336
views
Comparison between Snyk and Sonarcloud/SonarQube?
I need to do a comparison between the features and functionality of Snyk and Sonarcloud/Sonarqube and the only thing I can find is a speed comparison:
https://snyk.io/blog/sast-tools-speed-comparison-...
2
votes
1
answer
2k
views
Sonarcloud shows 0% coverage on new code, and also shows 0% coverage on master branch with gitlab ci
I am using GitLab ci to run SonarCloud code analysis on the code.
here is my gitlab-ci.yaml
stages:
- test
before_script:
- mkdir -p ~/.ssh &&
cp $gitlab_private_key ~/.ssh/id_ed25519 ...
0
votes
0
answers
50
views
Glue crawler resource requirements
After setting up an S3 glue crawler, SonarCloud has pointed out a security risk saying maybe I don't need to grant access to all resources. I'm using the template provided by AWS so I'm assuming it's ...
1
vote
1
answer
96
views
Use IS NULL and IS NOT NULL instead of direct NULL comparisons in postgreSQL
I have this sql query:
ALTER TABLE outfit
ADD CONSTRAINT check_non_empty_string CHECK (image_uri <> '');
This works good but SonarCloud raised this as a bug. I am using PostgreSQL 13.2, is ...
0
votes
1
answer
62
views
Why does SonarCloud show that everything is fine?
I'm working on a c# .net6 project and I'm trying to integrate SonarCloud using GitHub Actions.
I have a build and sonarcloud workflow that looks like this:
name: .NET
on:
push:
branches: [ main ...
0
votes
0
answers
483
views
Azure Pipelines SonarCloud task started to fail (since a few days)
Our company uses Azure DevOps Pipelines for building software. All pipelines are connected to SonarCloud for code analysis.
While all our plans (DevOps and Sonar) are paid, I expect to get faster and ...
0
votes
0
answers
111
views
re-use my sonar-scanner script in sonarcloud
I have a nodejs project written in TypeScript.
I have a SonarQube instance running on my local machine.
I have a configuration file for sonar scanner written in typescript called sonar-scanner.ts:
...
3
votes
2
answers
1k
views
CodeCoverage not showing in SonarCloud in a Python project
I'm trying to include the codecoverage from my Python project.
First I executed the command py.test --cov=tests/ --cov-report xml:cov/coverage.xml to run the tests and report to cov/coverage.xml
My ...
4
votes
1
answer
439
views
Sonar Cloud analysis on an NX monorepo
Am just trying to setup a monorepo of angular applications and libraries using NX. Am new to NX but have user sonarcloud before. Now my requirement is to run analysis for the different projects and ...
0
votes
0
answers
418
views
GitHub action sonarsource/sonarcloud-github-action is not working due to different github action (setup-spark)
sonarsource/sonarcloud-github-action (v1.6) github action is not working.
/entrypoint.sh: line 24: sonar-scanner: command not found
Based on this discussion here, it seems to be a PATH issue and we ...