Skip to content

Commit

Permalink
feat: adicionando versão 1.0 ao projeto
Browse files Browse the repository at this point in the history
  • Loading branch information
vitor-gabriel committed Jan 26, 2023
1 parent d11a0f9 commit 47ad64b
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Docker Composer do TOTVS Code Analisys OnPremise

Este repositorio existe para automatizar a configuração do TOTVS Code Analisys em sua maquina local, leia os passos com cuidado, qualquer duvida só entrar em contato comigo pelo [E-mail](mailto:vitor@r2vkconsultoria.com.br) ou pelo [LinkedIn](https://www.linkedin.com/in/vitor-gabriell/).

### Passos para intalação

1. Baixe o [Docker](https://www.docker.com/).
2. Faça a instalação do Docker e abra o programa.
3. Clone este [projeto](https://github.com/vitor-gabriel/TOTVS-Code-Analisys-OnPremise.git) e abra ele com o VSCode.
4. Rode o comando no terminal para fazer a instalação:
```
docker compose up
```
5. Coloque seus fontes na pasta */fontes* deste projeto.
6. Coloque os includes na pasta */fontes/includes*.
7. Execute novamente o quarto passo.
8. Na pasta */fontes/output* estará o resultado da sua analise, sempre seguindo esta estrutura do json abaixo:
```
{
"teste.prw":[
{
"severity":"ERROR",
"line":"5",
"rule":"CA2004-2",
"message":"Regra: CA2004-2: Formato de leitura não permitido do Metadados - SX3. | Conteúdo: Direct Access not allowed in data dictionary. - Linha: 5"
}
]
}
```

## Detalhes dos codigos de erro

Para obter mais informações sobre como corrigir erros no seu código-fonte, consulte este link: [Regras do SonarQube](https://sonar-rules.engpro.totvs.com.br/menu/rules).

## Creditos e maiores detalhes

Visite este link: [TOTVS Code Analisys](https://hub.docker.com/r/totvsengpro/advpl-tlpp-code-analyzer).

11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
advpl-code-analyzer:
image: totvsengpro/advpl-tlpp-code-analyzer:latest
ports:
- "8000:8000"
volumes:
- ./fontes:/tmp
- ./fontes/includes:/tmp/includes
- ./fontes/config:/bin/conf
- ./fontes/output:/bin/output
command: [ "/usr/bin/sonar-pipeline", "-v", "/tmp" ]
Empty file added fontes/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions fontes/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"breakList": [],
"breakOnError": true,
"printSonarFullOutput": true,
"printInternalWarnings": false
}
Empty file added fontes/includes/.gitkeep
Empty file.
Empty file added fontes/output/.gitkeep
Empty file.
32 changes: 32 additions & 0 deletions fontes/output/execution.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

[SONARQUBE] [RUNALONE] [Ver: 1.7] Release Aug 2022
Executando runAlone

|----------------------Parametros-----------------------------|
--> Root path: /bin/src/
--> Includes path: /bin/includes/
--> Json?: true
--> showPPOResult?: false
--> Json path: /bin/output/output.json
|-------------------------------------------------------------|

Iniciando parsing...


Iniciando Parsing.../bin/src/teste.prw
runInDll: OK
PPO try 1:

{
"teste.prw": [
{
"severity": "ERROR",
"line": "10",
"rule": "CA2004-2",
"message": "Regra: CA2004-2: Formato de leitura não permitido do Metadados - SX3. | Conteúdo: Direct Access not allowed in data dictionary. - Linha: 10"
}
]
}
Sucesso!
1Fim!
ADVPL Preprocessor: Precompilation of file /bin/src/teste.prw ok.
10 changes: 10 additions & 0 deletions fontes/output/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"teste.prw": [
{
"severity": "ERROR",
"line": "10",
"rule": "CA2004-2",
"message": "Regra: CA2004-2: Formato de leitura não permitido do Metadados - SX3. | Conteúdo: Direct Access not allowed in data dictionary. - Linha: 10"
}
]
}
16 changes: 16 additions & 0 deletions fontes/teste.prw
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#INCLUDE "TOTVS.CH"

User Function Teste()
Local lFound as Character
lFound := "C"

DbSelectArea("SX3")
DbGoTop()
DbSetOrder(1)
Dbseek(xFilial("SX3"+X3_CAMPO))

If lFound
MsgInfo("Achou!")
EndIf

Return

0 comments on commit 47ad64b

Please sign in to comment.