Articles → SONARQUBE → Run sonar scanner

Run sonar scanner






Android project




package com.example.demo_application;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.v("METHOD", "onCreate called");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.v("METHOD", "onStart called");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.v("METHOD", "onResume called");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.v("METHOD", "onPause called");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.v("METHOD", "onStop called");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.v("METHOD", "onDestroy called");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.v("METHOD", "onRestart called");
    }

}



Sonar scanner properties file




sonar.host.url=http://localhost:9000
sonar.sourceEncoding=UTF-8
sonar.projectKey=android-sample-1
sonar.projectName=Sonar_demo_project_1
sonar.projectVersion=1.0
sonar.scm.disabled=True
sonar.sources=src/main/java
sonar.language=android
sonar.java.binaries=build/outputs/apk/debug



















Run sonar scanner










sonar-scanner.bat





Click to Enlarge


Check the result











Click to Enlarge






Click to Enlarge






Click to Enlarge




Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, September 30, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250