less than 1 minute read

Analyze CodeCharta (Visualization Part) using SonarQube from zip file on Windows

  1. Clone CodeCharta from GitHub
  2. Download SonarQube 9.4
    download sonarqube
    1. Extract the downloaded zip file, jump into the folder and navigate to bin/windows-x86-64/ or any other OS
    2. double-click on StartSonar.bat file
    3. Wait until the terminal says SonarQube is operational
  3. Download the version 4.7 of SonarScanner
    download_sonarscanner
    1. Extract the downloaded zip file
    2. Add the bin directory of the sonar-scanner folder to the %PATH% environment variable
    3. To test if sonar-scanner works globally execute sonar-scanner.bat -h in your terminal
  4. Open http://localhost:9000
  5. Login with admin/admin
    login sonarqube
  6. Change your password
  7. Create a project ‘Manually’ and set up a project name and key
    create_project sonarqube
  8. Choose ‘Locally’ to analyze the project
  9. Generate a token and save it for later use
    token sonarqube
  10. Choose ‘Other’ and then ‘Windows’ to run analysis
    analysis_setup sonarqube
  11. Open the terminal, navigate to CodeCharta/visualization/ project folder to analyze and execute scanner using the shown command

    sonar-scanner.bat -D”sonar.projectKey=CodeCharta” -D”sonar.sources=.” -D”sonar.host.url=http://localhost:9000” -D”sonar.login=”user token”

  12. After a successful execution the analyzed project is shown on localhost
    analyzed_project sonarqube
  13. Install CodeCharta analysis

    npm i -g codecharta-analysis

  14. Execute ccsh sonarimport in your terminal to generate a cc.json file to load it into CodeCharta’s Visualization

    ccsh sonarimport “http://localhost:9000/” “CodeCharta” “–user-token=user token” “–output-file=output” “–merge-modules=false”