GithubHelp home page GithubHelp logo

sonarqube's Introduction

SonarQube
SonarQube Community Edition: your best buddy for code quality and security

GitHub language count GitHub top language GitHub license GitHub last commit

💺 Getting started

These instructions will get you a copy of the SonarQube Community Edition up and running on your local machine for development and testing purposes.

Setting up the development environment

The server is build using Docker Containers. Container is a standardized unit of software. Download Docker Desktop.

Setting up the server

Cloning the server

You can obtain the server by running the instruction bellow on your terminal:

git clone https://github.com/diegomais/sonarqube.git

Running the database and server

You can run the database and server by executing the instruction bellow on your terminal within the project directory:

docker-compose up

After the server is up, you can browse SonarQube at http://localhost:5000.

The default System administrator credentials are admin/admin.

Analyzing source code

Configuring your project

Create a configuration file in your project's root directory called sonar-project.properties:

# must be unique in a given SonarQube instance
sonar.projectKey=my:project

# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=.

# Encoding of the source code. Default is default system encoding
# sonar.sourceEncoding=UTF-8

# Default SonarQube server
sonar.host.url=http://sonarqube:9000

# Token generated when your project is created on browser
sonar.login=46dbe7b5171c84327706e73508daffd8

Running SonarScanner

Run the following command from the project base directory to launch the analysis:

docker run \
    --rm \
    -v "$PWD:/usr/src" \
    --network sonarqube_sonarnet \
    sonarsource/sonar-scanner-cli

After the task is done you can check the results on browser.

Multiple sub-projects

You can add a configuration file inside base directory of each sub-project and executing on parent folder:

for d in ./*/ ; do ( \
    cd "$d" && \
    docker run \
        --rm \
        -v "$PWD:/usr/src" \
        --network sonarqube_sonarnet \
        sonarsource/sonar-scanner-cli \
); done

Made with ❤️ by Diego Mais 👋.

sonarqube's People

Contributors

diegomais avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.