{"id":21155508,"url":"https://github.com/ortegavan/sonar","last_synced_at":"2026-02-21T14:32:37.448Z","repository":{"id":263290014,"uuid":"889778160","full_name":"ortegavan/sonar","owner":"ortegavan","description":"Passo a passo para executar Sonar localmente no macOS em uma aplicação Angular","archived":false,"fork":false,"pushed_at":"2024-11-17T15:46:44.000Z","size":146,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-26T23:42:22.775Z","etag":null,"topics":["sonarqube","typescript"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ortegavan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-17T07:51:47.000Z","updated_at":"2025-01-15T21:30:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff9b744c-0076-4c58-910f-ddfd23dc6906","html_url":"https://github.com/ortegavan/sonar","commit_stats":null,"previous_names":["ortegavan/sonar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ortegavan/sonar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortegavan%2Fsonar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortegavan%2Fsonar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortegavan%2Fsonar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortegavan%2Fsonar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ortegavan","download_url":"https://codeload.github.com/ortegavan/sonar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortegavan%2Fsonar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29683970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T14:31:22.911Z","status":"ssl_error","status_checked_at":"2026-02-21T14:31:22.570Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sonarqube","typescript"],"created_at":"2024-11-20T11:21:28.269Z","updated_at":"2026-02-21T14:32:37.430Z","avatar_url":"https://github.com/ortegavan.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Sonar: como rodar localmente\n\n### Setup\n\n1. Instale o JDK mais recente de https://www.oracle.com/cis/java/technologies/downloads/ \n\n2. Baixe o SonarScanner de https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/\n\n3. Ajuste o PATH do macOS para incluir o SonarScanner:\n\n\t1. Edite o arquivo de configuração do zsh:\n\n\t\t```bash\n\t\tnano ~/.zshrc\n\t\t```\n\n\t 2. Adicione o caminho do `bin`  do SonarScanner com a linha:\n\n\t\t```bash\n\t\texport PATH=\"/Users/seu_usuario/Downloads/sonar-scanner-\u003cversão\u003e/bin:$PATH\"\n\t\t```\n\n\t\tSalve o arquivo: `CTRL + O`\n\n\t\tSaia do arquivo: `CTRL+ X`\n\n\t\t3. Atualize o terminal:\n\n\t\t```bash\n\t\tsource ~/.zshrc\n\t\t```\n\n\t\t4. Verifique a instalação:\n\n\t\t```bash\n\t\tsonar-scanner --version\n\t\t```\n\n4. Permita a execução do Java (se ele foi bloqueado) em Preferências do Sistema \u003e Segurança e Privacidade.\n\n### Configurando o projeto\n\n1. Adicione o SonarScanner ao projeto:\n\n\t```bash\n\tnpm install --save-dev sonar-scanner\n\t```\n\n2. Adicione um script no `package.json`:\n\n\t```json\n\t\"scripts\": {\n\t  \"sonar\": \"sonar-scanner\"\n\t}\n\t```\n\n3. Crie o arquivo de configuração na raiz do projeto (neste exemplo usando Sonar cloud):\n\n\t```bash\n\ttouch sonar-project.properties\n\t```\n\n\t```properties\n\tsonar.organization=[sua organization]\n\tsonar.projectKey=[sua project key]\n\tsonar.projectName=[seu projeto]\n\tsonar.projectVersion=1.0\n\tsonar.language=ts\n\tsonar.sources=src\n\tsonar.tests=src\n\tsonar.test.inclusions=src/**/*.spec.ts\n\tsonar.host.url=https://sonarcloud.io\n\tsonar.token=[seu token]\n\t```\n\n4. Execute o SonarScanner:\n\n\t```bash\n\tnpm run sonar\n\t```\n\n### Usando SonarQube localmente\n\n1.  Instale o Docker Desktop se não tiver. No terminal, execute:\n\n\t```bash\n\tdocker run -d --name sonarqube -p 9000:9000 sonarqube\n\t```\n\n2. Acesse http://localhost:9000 com usuário e senha `admin` (será solicitado trocar no primeiro acesso) e crie o projeto local;\n\n3. Altere o token no arquivo `sonar-project.properties`, remova a linha de `organization` e altere a url para:\n\n\t```properties\n\tsonar.host.url=http://localhost:9000\n\t```\n\n4. Execute o SonarScanner:\n\n\t```bash\n\tnpm run sonar\n\t```\n\n\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortegavan%2Fsonar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fortegavan%2Fsonar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortegavan%2Fsonar/lists"}