Skip to content

@felipebz felipebz released this Apr 22, 2019 · 128 commits to master since this release

The "SonarQube PL/SQL Community plugin" is now called Z PL/SQL Analyzer (or ZPA)!

New rules:

  • Variables should comply with a naming convention (#26)
  • Avoid TO_CHAR in an ORDER BY clause

First-class support to test files:

  • Highlighting now also runs on test files
  • Coding rules are executed on test files
  • Added first rules to check test code using utPLSQL v3: "Tests should not be disabled" and "Test expectations should not be redundant"

Other highlights:

  • Many improvements in the parser.
  • Fixed some false positives in InsertWithoutColumnsCheck (#51), SelectAllColumnsCheck, NotASelectedExpression (#104), CommitRollbackCheck (#82) and UnusedParameterCheck (#90).
  • The properties sonar.plsql.* were deprecated in favor of sonar.zpa.*.

For custom plugin developers:

  • [BREAKING CHANGE] Custom plugins built against older versions of sonar-plsql-open-plugin must be updated. The classes considered part of the public API were moved to the package org.sonar.plugins.plsqlopen.api to follow the SonarQube guidelines (#102). Please read the documentation for more details: Migrating a plugin from a previous version. If your plugin depends on a class that isn't located in the public API, please open an issue.
  • An easier API was added to register violations.
  • You can get the "semantic info" of AST nodes using semantic(astNode). Currently you can use it to get the corresponding Symbol instance and its PL/SQL type (examples: 22a15b6#diff-d5bde9389c36c820ad9fc68efba26968 and b259903#diff-a42c3e1ee9a6f3b0254153351fdb8b7b).
  • MethodMatcher can check the type of arguments. Example: to find the ocurrence of TO_CHAR(varchar2_variable) you can use MethodMatcher.create().name("to_char").addParameters(PlSqlType.CHARACTER).
  • Checks can override visitComment(Trivia, String) to analyze and raise issues on comments.
  • It's possible to define if your check will run on all files (@RuleInfo(scope = RuleInfo.Scope.ALL)), main source files (@RuleInfo(scope = RuleInfo.Scope.MAIN)) or only on test files (@RuleInfo(scope = RuleInfo.Scope.TEST)).

This version supports SonarQube 6.7 and newer.

Assets 4
You can’t perform that action at this time.