Skip to content

#9343 - Refactor: Resolve bunch of sonar problems 2#9403

Merged
rrodionov91 merged 11 commits intomasterfrom
resolve-bunch-of-sonar-problems-2
Mar 19, 2026
Merged

#9343 - Refactor: Resolve bunch of sonar problems 2#9403
rrodionov91 merged 11 commits intomasterfrom
resolve-bunch-of-sonar-problems-2

Conversation

@gitquil07
Copy link
Copy Markdown
Collaborator

@gitquil07 gitquil07 commented Mar 9, 2026

How the feature works? / How did you fix the issue?

(Screenshots, videos, or GIFs, if applicable)

SonarQube Violation Fixes — Pull Request Description


Summary

This PR fixes 5 SonarQube rule violations across 33 files to improve code quality and type safety.

Rule Description Files Fix
S1444 Public static fields should be read-only 2 private static or readonly
S1871 Identical branches in conditional structure 6 Merged duplicate switch cases
S6861 Mutable variables should not be exported 1 export letexport const
S2933 Constructor-only fields should be readonly 20 Added readonly to operation classes
S1121 Assignments in sub-expressions 4 Extracted assignments from conditions/returns

Total: 33 files updated. No functional changes; behavior preserved.


How did you fix the issue?

  • S1444: Made singleton _instance private in SequenceEventDelegationManager; added readonly to React contextType in Save.tsx.
  • S1871: Merged identical switch branches (e.g., case Chem + default, case 'arrow' + case 'plus') to remove redundancy.
  • S6861: Replaced export let editorEvents with export const editorEvents and inline initialization; resetEditorEvents() now mutates in place.
  • S2933: Added readonly to constructor-only fields in 20 operation classes under packages/ketcher-core/src/application/editor/operations/.
  • S1121: Moved assignments out of while conditions and arrow-function returns into separate statements.

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

@auto-assign auto-assign bot requested a review from rrodionov91 March 9, 2026 17:49
@gitquil07 gitquil07 assigned gitquil07 and unassigned gitquil07 Mar 9, 2026
@gitquil07 gitquil07 linked an issue Mar 9, 2026 that may be closed by this pull request
@gitquil07 gitquil07 requested a review from svvald March 9, 2026 17:54
@AlexeyGirin AlexeyGirin changed the title #9343 - Resolve bunch of sonar problems 2 #9343 - Refactor: Resolve bunch of sonar problems 2 Mar 10, 2026
@gitquil07 gitquil07 changed the title #9343 - Refactor: Resolve bunch of sonar problems 2 9343 - Refactor: Resolve bunch of sonar problems 2 Mar 12, 2026
@gitquil07 gitquil07 changed the title 9343 - Refactor: Resolve bunch of sonar problems 2 #9343 - Refactor: Resolve bunch of sonar problems 2 Mar 12, 2026
@rrodionov91 rrodionov91 merged commit 5dde260 into master Mar 19, 2026
16 of 18 checks passed
@rrodionov91 rrodionov91 deleted the resolve-bunch-of-sonar-problems-2 branch March 19, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Resolve bunch of sonar problems (part 2)

3 participants