Giter Site home page Giter Site logo

njustfengkj / zpa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felipebz/zpa

0.0 1.0 0.0 3.92 MB

A parser and static source code analyzer for PL/SQL and Oracle SQL.

Home Page: https://felipezorzo.com.br/zpa/

License: GNU Lesser General Public License v3.0

Java 0.19% Standard ML 0.61% Kotlin 63.38% HTML 2.72% PLSQL 33.10% Batchfile 0.01%

zpa's Introduction

Z PL/SQL Analyzer - ZPA

Latest release Build Status Azure DevOps tests Quality Gate Status

The Z PL/SQL Analyzer (or simply ZPA) is a code analyzer for PL/SQL and Oracle SQL code.

You can use it in a SonarQube on-premise instance. SonarQube is an open platform to manage code quality. This project supports SonarQube 8.9.x and newer.

See some examples in our SonarQube instance!

Do you want to use this analyzer in a project hosted on SonarCloud? Try the zpa-cli!

Installation

  • Download the latest sonar-zpa-plugin release and copy to the SONARQUBE_HOME/extensions/plugins directory;
  • Restart your SonarQube server;
  • Navigate to the Marketplace (SONARQUBE_URL/marketplace?filter=installed). It should list "Z PL/SQL Analyzer" on the tab "Installed Plugins";
  • Run an analysis with SonarQube Scanner.

If you like to live on the bleeding edge, you can use the latest development version.

Compatibility matrix

ZPA version SonarQube version
3.0.0 7.6 - latest
3.1.0 (current) 7.6 - latest
3.2.0 (in development) 8.9 - latest

ZPA Toolkit

The ZPA Toolkit is visual tool to review the AST (abstract syntax tree) and the symbol table generated by the parser.

The latest ZPA Toolkit can be downloaded from the releases page and it requires JDK 11 or newer. You can also download the latest development version.

Contribute

Everyone is welcome to contribute. Note that no matter how you contribute, your participation is governed by our code of conduct.

There are a few things you need to know about the code. It is divided in these modules:

  • its - Integration tests with SonarQube (more below).
  • plsql-custom-rules - Demo project showing how to extend ZPA with custom coding rules.
  • sonar-zpa-plugin - The SonarQube plugin itself, this module contains all the code necessary to integrate with the SonarQube platform.
  • zpa-checks - The built-in coding rules provided by ZPA.
  • zpa-checks-testkit - Test helper for coding rules, it can be used to test custom rules.
  • zpa-core - The heart of this project. It contains the lexer, the parser and the code required to understand and process PL/SQL code.
  • zpa-toolkit - A visual tool to review the AST (abstract syntax tree) generated by the parser.

The API exposed to custom plugins must be located in the package org.sonar.plugins.plsqlopen.api (it's a requirement from the SonarQube server). The classes located outside this package are not prepared for external consumption, so if you use them, your code can break without any further notice.

If you're interested in a stable API to integrate ZPA with another software, please open an issue or contact us directly explaining your needs.

Running the integration tests

There are two sets of integration tests:

  • plugin: checks if the metrics are imported correctly in SonarQube
  • ruling: checks the quality of parser and rules against real-world code

To run the integrations tests, update the submodules:

git submodule update --init --recursive

Build the main plugin and the custom rules example:

./gradlew build publishToMavenLocal
./gradlew build -p plsql-custom-rules

Then run the tests:

./gradlew test -Pit

By default, the tests will be executed using SonarQube 8.9 LTS. You can change the SonarQube version using the property sonar.runtimeVersion, passing the specific version or one of LATEST_RELEASE[8.9] (for SonarQube 8.9.x LTS), LATEST_RELEASE (latest official release) or DEV (unstable version, in development):

./gradlew test -Pit -Dsonar.runtimeVersion=9.0

zpa's People

Contributors

felipebz avatar nmorais avatar phermsdorf avatar lm-net avatar l0wlik34g6 avatar juliorenedo avatar dependabot[bot] avatar fge avatar mcpiroman avatar vinupriyesh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.