Skip to content

Sonar S125 is load-dependent: prose comment lines ending in ';' fail the build on a starved runner #1216

Open

Description

@pal-tamas

CI run 37661989678 (job templates) failed on main 55bb9bc with src/Rask.Ui/UiChoice.cs(59,5): error S125: Remove this commented out code on a file untouched since 7a9861d; the same pack command was green in eight other jobs of that run. Fixed for that file in dfb5a9c by ending the sentence with a full stop.

Mechanism (read from SonarAnalyzer.CSharp 10.34.0.3385 source, CommentedOutCode.cs): a comment line ending in ; counts as code unless SentencePattern.SafeMatch succeeds; that regex runs with a 100 ms WALL-CLOCK timeout and SafeMatch swallows the timeout, so on a starved machine a prose line becomes 'code'. Not reproduced locally (inferred).

Still exposed (prose comment lines ending in ';'):

  • src/Rask.Core/Element.cs:232, Component.cs:202, Component.GlobalAttributes.cs:13
  • src/Rask.Server/App/RaskApp.cs:215, RaskEndpointExtensions.cs:2165
  • src/Rask.Dashboard/Panels/QueuePanelBase.cs:206, Pages/LogsPage.cs:255
  • src/Rask.Auth.Api/RaskAuthEndpointExtensions.cs:188
  • src/Rask.Generators/ComponentFactoryGenerator.SetterOverloads.cs:93, :864, .Entries.cs:264, .ComponentModel.cs:1045, .Setters.cs:159, RoutesGenerator.RoutesClass.cs:73
  • src/Rask.Site/Features/Lifecycle/LifecycleCycleDemo.cs:4, Shared/EmbeddedSource.cs:24

To do: reword those lines (line numbers as of 2d2ea79), and add a fast guard (a test or an analyzer-free grep in the format gate) that fails on a comment line ending in ';' so it cannot come back. Related: RaskDomEmit also has a wall-clock regex timeout that failed a local build at load 340.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions