Skip to content

Extract duplicated string literals into constants in main code (java:S1192) #738

Open

Description

@dfa1

SonarCloud flags duplicated string literals: inspector 7 (ExplorePage), writer 5, reader 2 (Compute:55, :56). List: java:S1192 open issues.

Out of scope: fbs-gen and proto-gen (32 findings). Those are code-generator templates where a constant would hurt readability.

How: pick one module, say so in a comment here, and send one PR. Use judgment: a constant for a name or key repeated across methods is good; for fragments like "</td>" in an HTML builder it may not be, so leave those and explain on the Sonar finding. Behavior must not change. See CONTRIBUTING.md.

Activity

  1. prajwalpoojari04 commented on Nov 18, 2026

    @prajwalpoojari04
    Contributor

    hey, i would like to work on this reader module for this issue.
    I noticed that SonarCloud has reported two duplicated string literals in Compute (lines 55 and 56).
    I'll inspect the occurrences, identify which strings would benefit from being extracted into constants, and make the necessary changes while ensuring that the existing behaviour remains unchanged.
    I'll keep my changes limited to the reader module and run the relevant tests before submitting a Pull Request.
    Please let me know if this module is available for contribution.

    Thank you!

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions