项目作者: frieder

项目描述 :
SonarQube Custom Java Checks
高级语言: Java
项目地址: git://github.com/frieder/sonar-rules.git
创建时间: 2018-08-01T14:37:58Z
项目社区:https://github.com/frieder/sonar-rules

开源协议:

下载


SonarQube Custom Java Checks

This project provides a few simple checks for Java to demonstrate the
implementation and use of custom rules in SonarQube.

  • NullableReturnCheck - Shows an issue on INFO level to the developer
    suggesting to consider using java.util.Optional or io.vavr.control.Option
    instead of a potentially nullable return value. Implementation is done using
    the visitor pattern available in Sonar.
  • NullnessAnnotationCheck - Forbids the use of any nullness annotations
    besides those of the Checker Framework. The
    rule itself is marked deprecated. There is a more generic approach
    available that does not require a custom rule —
    rule templates.
  • VavrPublicSignatureCheck - Forbid the use of vavr.io
    classes in public API. This includes public/protected methods used in
    interfaces and abstract classes.

Check the setup page to
get a brief overview of how to install this plugin.

Known Issues

It seems that Sonar is not able to catch type annotations. Both the
NullnessAnnotationCheck as well as the OOTB template “Track uses of
disallowed classes
“ are not able to match the use of a forbidden annotation.