Questions tagged [sonarqube]
SonarQube is the open source platform, to continuously inspect code quality of applications. It allows developers to detect bugs and vulnerabilities as well as to decrease code smells or bad practices, in more than 20 different languages.
11,381
questions
0
votes
0
answers
34
views
Noncompliant Code Java Infinite Loop SonarQube Bug java:S2189
I get sonar bug with code java:S2189 "Loops should not be infinite". I have explicit condition to finish my loop. Maybe I'm not seeing the problem. Is there a proper explanation for this bug?...
0
votes
0
answers
17
views
SonarQube in Azure DevOps Pipeline leads to error MSB6006: "csc.dll" exited with code 137
We are trying to use the SonarQube v5.5 extension in our Azure DevOps pipelines. The build runs fine as long as we do not include the pipeline task SonarQubePrepare in our azure-pipelines.yml file. As ...
0
votes
0
answers
22
views
Sonarqube catastrophic backtracking with regex that I use
So in one of my views I am using regex which is looking like that:
RegExp('^(?!(.|\n)*{\/?.+})(.|\n)*$')
ANd sonarlint is giving me a warning about catastrophic backtracking and should make sure that ...
0
votes
0
answers
19
views
SonarQube in Jenkins pipeline
Im new to SonarQube and try for the first time to run it over an .sln file in Jenkins pipeline.
I followed the instructions here and wrote the following commands in a stage:
bat"""
...
0
votes
0
answers
10
views
Can SonarQube and Lint report the same warnings and errors
I've started to use SonarQube in combination with Lint, and I've seen these two tools report different warnings and errors.
Could it be possible to make them reporting the same warnings and errors?
...
0
votes
1
answer
21
views
Obj: Immediately return this expression instead of assigning it to the temporary variable
const whiteListUrls = await this.whiteListDomainsRepository.find({
where: {and: [{isActive: true}, {type: 'redirect'}]},
});
This whiteListUrls give a array like:
[
WhiteListDomain {
...
0
votes
0
answers
15
views
Sonarqube service running, but not allowing traffic to the default port 9000
I recently installed sonarqube to include in continous code analysis pipeline for jenkins.
Having installed the sonarqube and started the service with the sonarqube.service systemd file, Sonarqube ...
0
votes
0
answers
11
views
Coverity Scan for JS
I have initiated the Coverity scan for the JS using Coverity Wizards.
The capture build step has been completed & failed in to Run analysis step.
The failed message is "failed with error code ...
0
votes
0
answers
11
views
How to exclude all the classes of a java maven project from sonar coverage execution?
I am trying to exclude all the classes of my java maven project from sonar code coverage execution. I am using the below property, but it is not excluding anything
``` <properties>
<...
0
votes
2
answers
30
views
Change the version of a project in SonarQube from jenkins dynamically
I need to pass the version number dynamically for sonar projects from jenkins pipeline. For that i have the version.txt file in the directory. I have declared that directory as variable in the script. ...
1
vote
1
answer
55
views
Casting struct* to void*
I have a following function in C:
Bool message(void* msg, unsigned timeout);
and a structure that I want to pass to that function:
msgSPI_t msgSPI; //msgSPI_t is of struct type
like so:
message(&...
0
votes
1
answer
64
views
You're not authorized to run analysis. Please contact the project administrator Sonarqube local
I have very basic setup of sonarqube. It is in initial phase only and it's kind of strange that I'm not able to access sonarqube report at localhost:9090 (default is of course 9000 but I just changed ...
0
votes
0
answers
31
views
java.lang.NoSuchMethodError: 'void org.springframework.web.servlet.DispatcherServlet.setEnableLoggingRequestDetails(boolean)
i'm new to Springboot and tried to upload my project to SonarQube to check for errors. When executing the MavenCommand to upload my project i get this error.
Thanks in advance
ProfiHartzer
[ERROR] ...
0
votes
0
answers
11
views
Is Java 8 or 9 Required for Sonarlint in Visual Studio Code
Inquiring if Java 8 or 9 is required when running Sonarlint in Visual Studio Code, kept receiving error "Couldn't start client SonarLint Language Server". Currently have Java 1.8 installed ...
0
votes
0
answers
18
views
Sonar Issue for access SchemaFactory to validate xml with XSD file
I am validating xml file with XSD and I am getting sonar issue for SchemaFactory object creation
XML parsers should not be vulnerable to XXE attacks so I have set the below properties
schemaFactory....
0
votes
1
answer
32
views
Using Mockito Spy
I tried to write a Junit test case for below service class of Spring Boot app.
@Service
@Transactional
public class MyService {
private static final Logger log = LoggerFactory.getLogger(ataService....
0
votes
0
answers
49
views
SonarQube analysis is failing with the error server-wide lines of code total to exceed your 500000
We are using the developer edition of SonarQube 9.2. Our license details are like below
Our code analysis is failing with the below error
{"task":{"id":"AYFL9d206YvWba2a7DkU&...
0
votes
1
answer
29
views
Cannot remove .sonarqube folder on a Windows agent in a DevOps Server pipeline due to an invisible file
In our pipelines building .NET apps, we use SonarScanner for Azure DevOps version 4.23.1, using the MSBuild integration. Sometimes, the tasks leave some mess in the .sonarqube directory inside the ...
0
votes
1
answer
18
views
Two Different Projects on SonarQube using same plugin, but applying different rules from Plugin
So suppose on a single SonarQube instance, two different projects want to be onboarded and scanned. They are to be scanned using the same plugin, but we want to apply different custom rules (and ...
0
votes
1
answer
17
views
sonarqube scanner on circleci
I am using Sonarqube and CircleCI for code quality scan.
However, I don't know how if it is possible to start up a Sonarqube Server on CircleCI and use it to run the scanner.
This is my current config....
0
votes
0
answers
25
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
2
answers
54
views
Sonarqube Major issue "Refactor code so that stream pipeline is used"
im working in java 17 project and i have the following method :
public List<String> getUserroles(List<UserRoleDTO> userRoles) {
return userRoles.stream().filter(UserRoleDTO::...
0
votes
0
answers
21
views
azure devops TFS SonarQube tasks causes build agent to become disabled
I have TFS 2017 with a build definition that executes successfully. I have a SonarQube server 7.9.1 and I also installed the latest TFS SonarQube extensions, so that now I have available the “Prepare ...
-1
votes
1
answer
17
views
Sonarqube ignoring angular unit test spec files
We have a Quality Gates for our Angular 13 project, and we have to make our coverage more than 80%.
The problem is the SonarQube which lives on our dev server is ignoring the unit test files, it shows ...
0
votes
1
answer
48
views
AES Encryption algorithms and padding scheme
Hello currently i have to do an AES encription and send it to an external SW but i am having trouble with the sonarqube.
this is the relevant part of my current code:
String encriptedPad = ...
0
votes
0
answers
26
views
dotnet sonarscanner fails during Docker builds
I am working on implementing a solution for a sonar scanner inside a docker container for the .net core application in azure DevOps.
Currently, the sonarqube installed was on a sonarqube namespace in ...
0
votes
0
answers
22
views
SonarQube with mixed .NET and Angular Projects
I am new to SonarQube. My goal is to set up SonarQube to scan a .NET Solution with mixed content - Some Projects are using C# and one is written in TS/Angular. The Project structure looks like this:
...
1
vote
0
answers
55
views
Calling the SonarScanner CLI., Could not find 'java' executable in JAVA_HOME or PATH. for DotNet
I am trying to run sonarqube from docker on linux agent.
install dotnet scanner
dotnet tool install --global dotnet-sonarscanner --version 5.6.0
dotnet sonarscanner begin and dotnet build commands ...
1
vote
0
answers
58
views
Github Actions Sonar Scanner can't resolve file paths in lcov.info
First off, I am aware, that there are resolved issues that are similar to mine, but I've tried every possible answer 50 times, so I think my case might be unique.
I'm trying to upload the lcov.info ...
0
votes
0
answers
14
views
Refactor of function below function
I have created below if statement but facing error as refactor this function. I need to to resolve this error. I tried different scenario but not working.I need to split if condition in many small ...
0
votes
1
answer
35
views
Connection refuse while connecting to sonar from gitlab
I am facing issue while configuring Gitlab pipeline with SonarQube.
Gitlab running on localhot port 80 and Sonar running on localhost port 9000 in the same local linux machine.
If I am executing ...
0
votes
0
answers
10
views
My deploy from maven to sonarqube failed. see report below
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project maven-web-application: Failed to retrieve remote metadata com.mt:maven-web-application:3.0.3-...
2
votes
1
answer
47
views
SonarQube Configuration
We had recently implemented SonarQube in our team and we have a dashboard configured
We've been able to see some of the details but the line coverage and code coverage is 0 always
Can you advise what ...
0
votes
2
answers
42
views
Sonar violation in Java on DoubleValue.equals(AnotherDoubleValue) - Why?
I have a piece of code in Java where -
public boolean method1(Double d1, Double d2) {
if (d1.equals(d2)) {
//Some logic
return bool;
}
The statement d1.equals(d2) has a sonar violation ...
0
votes
0
answers
34
views
How to resolve the "Verify the message's origin in this cross-origin communication" vulnerability in sonarqube.?
My project runs the sonarqube scan for each build.
In the line self.addEventListener, I have the "Verify the message's origin in this cross-origin communication." vulnerability in scan ...
0
votes
1
answer
49
views
Sonarscanner cannot reach sonarqube server using docker-compose
I have just created my docker-compose file, trying to run sonarqube server along side posgres and sonarscanner. The sonarqube server and the database can connect however my sonarscanner cannot reach ...
-1
votes
0
answers
14
views
Do I need to filter for protection echo $ _GET in html [duplicate]
I use several get methods in my code and my code quality scanner says I have a problem.
<input type="text" class="form-control datepicker" name="start_date" value=&...
0
votes
0
answers
31
views
Sonarqube not taking required quality profile
We have two types of codes(Webmethods and Axway) which need to be scanned using sonarqube. For webmethods SCA, I have installed a i8c flow plugin in sonarqube server and for axway I have installed ...
0
votes
0
answers
12
views
SonarQube Scanner login failure
I have configured the sonar multiple times, through user data and manually also. the dashboard is appeared, unable to login into it. every time there is incorrect password, even though typing correct ...
-3
votes
0
answers
32
views
Refactor of function
I have created below function but facing error as refactor this function. I need to to resolve this error. I tried different scenario but not working.
received error on sonarqube as 'Refactor this ...
-1
votes
0
answers
21
views
SonarQube code coverage different from Scoverage for Scala Project
I have added SonarQube and Scoverage integration to my Scala project. My Scoverage report has a code coverage of close 80% while my SonarQube code coverage is around 50%.
When I examined it closely I ...
0
votes
0
answers
16
views
INFO: Project root configuration file: NONE
I am new to Sonarqube. when I am building Jenkins pipeline, I am having “INFO: Project root configuration file: NONE” error. I tried whole day to fix it. but still couldn’t.
Jenkins Pipeline script
...
0
votes
1
answer
29
views
The Cyclomatic Complexity of this method is 13 which is greater than 10 authorized
Please help reduce the cyclomatic complexity of this method. I don't really understand how this can be done, I need all the conditions in this method and obviously there are no duplicates.
private ...
-1
votes
0
answers
24
views
java.lang.IllegalStateException: Authentication error when executing blame for file
JDK 11, SonarQube: 9.1
When I build my project local it's success, but when run Jenkin's job with SonarQube I get error:
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (...
0
votes
0
answers
25
views
Make sure that using a regular expression is safe here. SonarQube
SonarQube FAILED due to - Make sure that using a regular expression is safe here.
How we can ensure regular expression is safe in Node.js?
// Special characters like (/[(){}#@!?;:) are not ...
0
votes
1
answer
32
views
Master and develop branch analysis in sonarQube (Community Edition)
I am using sonarqube community edition which does not support multi-branch analysis. Is there any way to have develop and master branch code displayed under different project reports in sonarqube(i.e ...
0
votes
0
answers
22
views
SonarQube - Failed to get CE Task status - HTTP code 502
I am trying to run sonarqube (hosted remotely) via SonarScanner command through local machine for magento application (for PHP), but getting below error every time. I tried to find solution for this, ...
0
votes
0
answers
12
views
ERROR: Error during SonarQube Scanner execution: org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
I am new to Sonarqube. when I am building Jenkins pipeline with 'DEV' environment I am having error in Sonar Analyze stage. but it successfully builds with 'DEV2' environment.
here is the sonar ...
0
votes
0
answers
15
views
Split function in node js
I need to to split function into small 2 or 3 functions to avoid sonar issue but getting error. any option available to split for loop. when i try to split its showing its depend on for loop we cant ...
0
votes
0
answers
20
views
Sonar coverage is showing zero percentage even though jest coverage is showing correctly
I am using jest for unit testing, jest is showing code coverage as expected but while I run the sonar the coverage is showing zero only.
package.json is like this below.
"devDependencies": {
...