All Projects → SonarSource → Sonar Java

SonarSource / Sonar Java

Licence: other
☕️ SonarSource Static Analyzer for Java Code Quality and Security

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Sonar Java

sonarlint4netbeans
SonarLint integration for Apache Netbeans
Stars: ✭ 23 (-96.91%)
Mutual labels:  quality, static-code-analysis, static-analysis, sonarqube, analyzer, static-analyzer
Sonarondocker
🐳 📡 Docker way of running SonarQube + any DB
Stars: ✭ 25 (-96.64%)
Mutual labels:  static-analysis, quality, sonarqube, static-analyzer
Sonarjs
SonarSource Static Analyzer for JavaScript and TypeScript
Stars: ✭ 696 (-6.58%)
Mutual labels:  static-analysis, sonarqube, static-code-analysis, static-analyzer
Zpa
A parser and source code analyzer for PL/SQL and Oracle SQL.
Stars: ✭ 124 (-83.36%)
Mutual labels:  static-analysis, analysis, quality, sonarqube
Security Code Scan
Vulnerability Patterns Detector for C# and VB.NET
Stars: ✭ 550 (-26.17%)
Mutual labels:  static-analysis, analysis, static-code-analysis, analyzer
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-98.12%)
Mutual labels:  analysis, static-code-analysis, static-analysis, static-analyzer
Dg
[LLVM Static Slicer] Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode.
Stars: ✭ 242 (-67.52%)
Mutual labels:  static-analysis, analysis, static-code-analysis, static-analyzer
Sonar Dotnet
Code analyzer for C# and VB.NET projects https://redirect.sonarsource.com/plugins/vbnet.html
Stars: ✭ 466 (-37.45%)
Mutual labels:  static-analysis, sonarqube, static-code-analysis, static-analyzer
Phan
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Stars: ✭ 5,194 (+597.18%)
Mutual labels:  static-analysis, analysis, static-code-analysis, analyzer
eba
EBA is a static bug finder for C.
Stars: ✭ 14 (-98.12%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
codeclimate-phpcodesniffer
Code Climate Engine for PHP Code Sniffer
Stars: ✭ 27 (-96.38%)
Mutual labels:  quality, static-code-analysis, static-analysis
codeclimate-eslint
Code Climate Engine for ESLint
Stars: ✭ 86 (-88.46%)
Mutual labels:  quality, static-code-analysis, static-analysis
nakedret
nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length.
Stars: ✭ 82 (-88.99%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
custom-bytecode-analyzer
Java bytecode analyzer customizable via JSON rules
Stars: ✭ 66 (-91.14%)
Mutual labels:  analysis, static-analysis, analyzer
sonar-gherkin-plugin
SonarQube Cucumber Gherkin Analyzer
Stars: ✭ 33 (-95.57%)
Mutual labels:  static-analysis, sonarqube, static-analyzer
identypo
identypo is a Go static analysis tool to find typos in identifiers (functions, function calls, variables, constants, type declarations, packages, labels).
Stars: ✭ 26 (-96.51%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
codeclimate-duplication
Code Climate engine for code duplication analysis
Stars: ✭ 96 (-87.11%)
Mutual labels:  quality, static-code-analysis, static-analysis
Prealloc
prealloc is a Go static analysis tool to find slice declarations that could potentially be preallocated.
Stars: ✭ 419 (-43.76%)
Mutual labels:  static-analysis, static-code-analysis, static-analyzer
unimport
unimport is a Go static analysis tool to find unnecessary import aliases.
Stars: ✭ 64 (-91.41%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
analysis-net
Static analysis framework for .NET programs.
Stars: ✭ 19 (-97.45%)
Mutual labels:  analysis, static-code-analysis, static-analysis

Code Quality and Security for Java Build Status Quality Gate Coverage

This SonarSource project is a code analyzer for Java projects. Information about the analysis of Java features is available here.

Features

Useful links

Have question or feedback?

To provide feedback (request a feature, report a bug etc.) use the SonarQube Community Forum. Please do not forget to specify the language (Java!), plugin version and SonarQube version.

If you have a question on how to use plugin (and the docs don't help you), we also encourage you to use the community forum.

Contributing

Topic in SonarQube Community Forum

To request a new feature, please create a new thread in SonarQube Community Forum. Even if you plan to implement it yourself and submit it back to the community, please start a new thread first to be sure that we can use it.

Pull Request (PR)

To submit a contribution, create a pull request for this repository. Please make sure that you follow our code style and all tests are passing (all checks must be green).

Custom Rules

If you have an idea for a rule but you are not sure that everyone needs it you can implement a custom rule available only for you. Note that in order to help you, we highly recommend to first follow the Custom Rules 101 tutorial before diving directly into implementing rules from scratch.

Work with us

Would you like to work on this project full-time? We are hiring! Check out https://www.sonarsource.com/hiring

Testing

To run tests locally follow these instructions.

Build the Project and Run Unit Tests

To build the plugin and run its unit tests, execute this command from the project's root directory:

mvn clean install

Integration Tests

To run integration tests, you will need to create a properties file like the one shown below, and set the url pointing to its location in an environment variable named ORCHESTRATOR_CONFIG_URL.

# version of SonarQube Server
sonar.runtimeVersion=7.9

orchestrator.updateCenterUrl=http://update.sonarsource.org/update-center-dev.properties

# Location of Maven local repository is not automatically guessed. It can also be set with the env variable MAVEN_LOCAL_REPOSITORY.
maven.localRepository=/home/myName/.m2/repository

With for instance the ORCHESTRATOR_CONFIG_URL variable being set as:

export ORCHESTRATOR_CONFIG_URL=file:///home/user/workspace/orchestrator.properties

Before running the ITs, be sure your MAVEN_HOME environment variable is set.

Sanity Test

The "Sanity Test" is a test which runs all checks against all the test sources files without taking into account the result of the analysis. It verifies that rules are not crashing on any file in our test sources. By default, this test is excluded from the build. To launch it:

mvn clean install -P sanity

Plugin Test

The "Plugin Test" is an integration test suite which verifies plugin features such as metric calculation, coverage etc. To launch it:

mvn clean install -Pit-plugin

Ruling Test

The "Ruling Test" are an integration test suite which launches the analysis of a large code base, saves the issues created by the plugin in report files, and then compares those results to the set of expected issues (stored as JSON files).

To run the test, first make sure the submodules are checked out:

git submodule init 
git submodule update

Launch ruling test:

cd its/ruling
mvn clean install -DskipTests=false

This test gives you the opportunity to examine the issues created by each rule and make sure they're what you expect. Any implemented rule is highly likely to raise issues on the multiple projects we use as ruling code base.

  • For newly implemented rule, it means that a first build will most probably fail, caused by differences between expected results (without any values for the new rule) and the new results. You can inspect these new issues by searching for files named after your rule (squid-SXXXX.json) in the following folder:

      /path/to/project/sonar-java/its/ruling/target/actual/...
    
  • For existing rules which are modified, you may expect some differences between "actual" (from new analysis) and expected results. Review carefully the changes which are shown and update the expected resources accordingly.

All the json files contain a list of lines, indexed by file, expliciting where the issues raised by a specific rule are located. If/When everything looks good to you, you can copy the file with the actual issues located at:

its/ruling/target/actual/

Into the directory with the expected issues:

its/ruling/src/test/resources/

For example using the command:

cp its/ruling/target/actual/* its/ruling/src/test/resources/

License

Copyright 2012-2021 SonarSource.

Licensed under the GNU Lesser General Public License, Version 3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].