Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sourcecode analysis #457

Open
wolframhaussig opened this issue Jun 14, 2021 · 2 comments
Open

add sourcecode analysis #457

wolframhaussig opened this issue Jun 14, 2021 · 2 comments

Comments

@wolframhaussig
Copy link
Contributor

I would like to suggest using SonarQube to keep code quality up. SonarQube is a code analyzer to point out bugs, potential security issues and code smells. SonarCloud is free to use for opensource projects and is easy to connect. I took the liberty to connect my pf4j fork to the SonarQ cloud: https://sonarcloud.io/dashboard?id=wolframhaussig_pf4j

Here is the PR for the change to support SonarQube: https://github.com/wolframhaussig/pf4j/pull/1/files . You can get started by going to the projects settings -> integrations -> SonarQube

@decebals
Copy link
Member

It's a good idea.
I created #458.

@wolframhaussig
Copy link
Contributor Author

Unfortunately, SonarQube will not run on foreign Pull requests (see details here) - sorry for that...

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project pf4j: You're not authorized to run analysis. Please contact the project administrator.

So we either ignore the pipeline error on external Pull requests or we update the build.yml to only run when the token exists:

script: >-
  if [ "${SONAR_TOKEN}" != "" ]; then
    cd pf4j && mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
  else
    cd pf4j && mvn -B verify
  fi

Note: above code is untested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants