Coder Social home page Coder Social logo

sonar-bulk-analyzer's Introduction

sonar-bulk-analyzer

Tool for bulk project analysis in SonarQube

This tool uses the following pipeline:

  • Parse the input file with projects
  • Clone the projects
  • Build the projects
  • Create the projects in SonarQube
  • Set default profile to the profile you specified
  • If project uses Gradle inject the sonar plugin into the build.gradle file.
  • Run the analysis

Usage

$ java -jar sonar-bulk-analyzer-0.1.jar --help
Sonar Bulk Analyzer 0.1-beta
Usage: sba [build] [options]

  -o, --out <dir>          Directory where projects will be cloned to
  -r, --repoFile <file>    File where to take repositories to clone from
  -p, --parser <parserClass>
                           Parser to use when parsing repository file
  -e, --error <dir>        Directory to store errors and output from build proccess
  -s, --sonar-version <version>
                           SonarQube plugin version to add to Gradle files
  -t, --token <token>      Token to use when authenticating with SonarQube
  --sonar-url <url>        SonarQube location
  --default-profile <profile>
                           Default profile to set for Sonar projects
Command: build
Build the projects in provided directory
  --help                   Display help

Corpus format

Currently only single parser is implemented for the following corpus file

Issues

  • Gradle build process too custom
    • How to include plugins node into the gradle build file
  • External dependencies such as need to add some kind of files before build
  • Android SDK required to build Android projects
  • SDK license manager
  • Some projects are missing build systems, so its not possible to programmatically compile them efficiently

sonar-bulk-analyzer's People

Contributors

zukkari avatar

Watchers

James Cloos avatar  avatar  avatar

sonar-bulk-analyzer's Issues

Implement commands of LOC extraction

JSON:

{
"component": {
"id": "AXDZIXeH1TfF-cqqcAMZ",
"key": "dada",
"name": "571ac88b-9b75-4b2a-b4ef-f2f070ea95ba",
"qualifier": "TRK",
"measures": [
{
"metric": "ncloc",
"value": "2707"
}
]
}
}

URI:

/api/measures/component?metricKeys=ncloc&componentKey=dada

Issues found during anaylsis

  • Data class:
[ERROR] Unable to run check class io.github.zukkari.checks.DataClassRule - DataClassRule on file 'android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java', To help improve SonarJava, please report this problem to SonarSource : see https://www.sonarqube.org/community/
java.lang.NullPointerException: null
	at io.github.zukkari.checks.DataClassSyntax$DataClassOps.$anonfun$getters$1(DataClassRule.scala:84)
	at scala.collection.immutable.List.map(List.scala:226)
	at io.github.zukkari.checks.DataClassSyntax$DataClassOps.getters(DataClassRule.scala:84)
	at io.github.zukkari.checks.DataClassRule.visitClass(DataClassRule.scala:46)
	at org.sonar.java.model.declaration.ClassTreeImpl.accept(ClassTreeImpl.java:203)

Implement batching

Currently the analysis starves the system so much that linux kernel kills the proccess. Should implement batching and free some resources after running each batch.

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.