Hi!
Since September 8th our SonarCloud GitHub Action slowed down remarkably. Before it was ~10 mins, since then it’s 30-40 mins. In early September we did not change any rules.
We made a few runs with detailed logs using these commands:
dotnet sonarscanner begin /k:"***" /o:"***" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build -p:reportanalyzer=true -v:diag
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
Here is a snippet from the logs:
2023-11-07T16:31:57.7451313Z Microsoft (R) Visual C# Compiler version 4.7.0-3.23465.3 (b5c9211b) (TaskId:1975)
2023-11-07T16:31:57.7496766Z Copyright (C) Microsoft Corporation. All rights reserved. (TaskId:1975)
2023-11-07T16:31:57.8220439Z 16:31:57.683 5:17>CSC : warning S3904: Provide an 'AssemblyVersion' attribute for assembly 'ABC.Data'. (https://rules.sonarsource.com/csharp/RSPEC-3904) [/home/runner/work/ABC/ABC/ABC.Data/ABC.Data.csproj]
2023-11-07T16:31:57.8252727Z NOTE: Elapsed time may be less than analyzer execution time because analyzers can run concurrently. (TaskId:1975)
2023-11-07T16:31:57.8769800Z Total analyzer execution time: 1020.954 seconds. (TaskId:1975)
2023-11-07T16:31:57.8782175Z Time (s) % Analyzer (TaskId:1975)
2023-11-07T16:31:57.8796587Z 995.222 97 Microsoft.CodeAnalysis.NetAnalyzers, Version=7.0.8.35404, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (TaskId:1975)
2023-11-07T16:31:57.8825829Z 978.075 95 Microsoft.NetCore.Analyzers.Data.ReviewSqlQueriesForSecurityVulnerabilities (CA2100) (TaskId:1975)
2023-11-07T16:31:57.8843632Z 8.829 <1 Microsoft.NetCore.Analyzers.Runtime.DisposeObjectsBeforeLosingScope (CA2000) (TaskId:1975)
2023-11-07T16:31:57.8855764Z 2.024 <1 Microsoft.CodeQuality.Analyzers.QualityGuidelines.ValidateArgumentsOfPublicMethods (CA1062) (TaskId:1975)
2023-11-07T16:31:57.8864549Z 0.788 <1 Microsoft.NetCore.Analyzers.Security.DoNotCallDangerousMethodsInDeserialization (CA5360) (TaskId:1975)
2023-11-07T16:31:57.8879008Z 0.632 <1 Microsoft.NetCore.Analyzers.Runtime.UseAsyncMethodInAsyncContext (CA1849) (TaskId:1975)
/* there are a lot more lines here, but every Analyzer needs less than 1 sec to run */
This project only uses C#, we are currently on .NET 6.
Unfortunately, we didn’t have detailed logs before we started to experience this issue.
The interesting this is that I could not find any information about Microsoft.CodeAnalysis.NetAnalyzers 7.0.8.35404, we could only find the 7.0.4, even though we also checked the prerelease variants.
We are always using the newest dotnet-sonarscanner.