Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How useful is to show all Delphi hints and warnings as issues inside the sonarqube? #17

Open
Valdeirsk8 opened this issue Nov 13, 2023 · 1 comment

Comments

@Valdeirsk8
Copy link

I'm question it because I think it's possible to import the Delphi build log and create issues at SonarQube using this pluglin.

For me it's make sense because I have a legacy application to mantaing, so if I can see it as issue in SonarQube I can address the fix to my team, and we can see if it's becaming better or worse.

On my C.I (Jenkins) when I build the application I use to generate a the build log, and in this file there a a list of hints and warning tha can be imported as issue.

msbuild PlenusPDV.dproj /p:Configuration=Release /target:Build /p:config=Release /P:platform=Win32  > "build.log"
  (...)
  src\UDataModulo1.pas(3951): Hint warning H2164: Variable 'aStr' is declared but never used in 'TDataModulo1.ValidaDados' 
  src\UDataModulo1.pas(201): Hint warning H2219: Private symbol 'IsNInteger64' declared but never used 
  src\UDataModulo1.pas(208): Hint warning H2219: Private symbol 'Get_ID_Planilha' declared but never used 
  src\URegistradoraAbertura.pas(193): Hint warning H2077: Value assigned to 'TFrmRegistradoraAbertura.Abrir' never used 
  src\URegistradoraAbertura.pas(205): Hint warning H2077: Value assigned to 'TFrmRegistradoraAbertura.InserirLog' never used 
  src\URegistradoraAbertura.pas(235): Hint warning H2077: Value assigned to 'TFrmRegistradoraAbertura.InserirMovimentacaoContabil' never used 
  src\URegistradoraAbertura.pas(302): Hint warning H2077: Value assigned to 'TFrmRegistradoraAbertura.InserirPeriodo' never used 

    6102 Aviso(s)
    0 Erro(s)

Tempo Decorrido 00:02:46.39

In this case I have 6102 hints and warning. It's quite complicated to handle with it manually;

@Cirras
Copy link

Cirras commented Nov 17, 2023

Hi @Valdeirsk8,

With integrated-application-development/sonar-delphi, you can create custom rules via a programmatic Java API.
Following from that, you could create a custom Delphi rule to read the build log and generate sonar issues. 😄

See: CUSTOM_RULES_101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants