GithubHelp home page GithubHelp logo

jvilya / sonar-android-plugin Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 4.0 889 KB

SonarQube plugin for supporting Android Lint

License: GNU Lesser General Public License v3.0

Kotlin 4.05% HTML 93.55% Java 2.40%
sonar-plugin sonarqube android-lint

sonar-android-plugin's Introduction

SonarQube Android Lint Plugin

SonarQube plugin for supporting Android Lint

Features

  • Integrates Android Lint for static code analysis
  • Up to date rules (1 vulnerability, 88 bugs, 224 code smells - 313 in total)
  • Supports SonarQube 6.7.7 and up

Profile

Details

Rules

Plans

  • Add support of custom lint checks
  • Implement sensor that runs Android Lint analysis on its own (not just parsing lint-results.xml file)

Settings

To specify Android Lint report file you can use sonar.android.lint.reportPaths property. It's comma-delimited list of paths to AndroidLint reports.

For example, in the project configuration

sonarqube {
    properties {
        property "sonar.android.lint.reportPaths", "build/reports/lint-results.xml"
    }
}

or SonarQube's project settings

Settigns

Usage

Get the latest version from the Releases Page. Put the jar to $SONAR_HOME/extensions/plugins folder. Restart SonarQube.

Or build plugin by yourself

  • git clone https://github.com/jvilya/sonar-android-plugin
  • cd sonar-android-plugin
  • mvn package
  • cp target/sonar-android-lint-[enter_version].jar $SONAR_HOME/extensions/plugins
  • cd $SONAR_HOME/bin/[your_os]
  • ./sonar.sh restart

Why?

There are several similar projects.

One of them is Android Lint Plugin. But it's too old - the last commit was more than 4 years ago. Also, it doesn't support a lot of new rules provided by Android Lint.

Another one is SLang with Kotlin Plugin. It allows you to import Android Lint issues as external. You can read more about this type of issues here - Importing Third-Party Issues.

The support of external issues looks nice if you are ok with its limitations:

  • you can't manage them within SonarQube; for instance, there is no ability to mark them False Positive.
  • you can't manage the activation of the rules that raise these issues within SonarQube. External rules aren't visible on the Rules page or reflected in Quality Profiles.
  • external issues and the rules that raise them must be managed in the configuration of your linter.

As a result, this plugin was developed for providing the native SonarQube's experience to work with Android Lint issues.

sonar-android-plugin's People

Contributors

jvilya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sonar-android-plugin's Issues

This plugin Rules cannot be used in SonarQube's projects?

Hi, I'm having some trouble with SonarQube custom rules.

I imported two rule plugins in the sonarqube-9.6.1.59531/extensions/plugins directory

sonar-android-lint-1.1.0.jar and ecocode-android-1.1.0.jar

The sonar-android-lint-1.1.0.jar shows a separate language, not belongs to Java or kotlin in quality Profiles, and cannot be configured for project use.

image

The ecocode-android-1.1.0.jar is shown in Java and can be used by projects.

image

I don't speak English well, I hope you can understand, thank you, and look forward to your reply.

Do we expect LTS for this plugin?

Hi @jvilya I am really impressed with this plugin. thanks for your love and contribution.

before we wanted to use this plugin in production, we have couple of questions , posted below.? would be great if you can address it.

  1. When can we expect this plugin to be published in sonar marketplace officially.
  2. What about Long term support?

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.