Skip to content

Fix SonarCloud issues: simplify email regex in pre_gen_project.py - #40

Merged
renefritze merged 1 commit into
mainfrom
claude/intelligent-fermi-BlwPV
May 31, 2026
Merged

Fix SonarCloud issues: simplify email regex in pre_gen_project.py#40
renefritze merged 1 commit into
mainfrom
claude/intelligent-fermi-BlwPV

Conversation

@renefritze

Copy link
Copy Markdown
Owner

Summary

  • Replaces the overly complex RFC 5322 email regex (complexity score 88) with a simple, readable validator
  • Fixes 8 open SonarCloud issues in hooks/pre_gen_project.py:
    • S5843 – Regex complexity reduced from 88 to well under the allowed 20
    • S5869 – Removed duplicate characters in character classes
    • S6353 (×6) – Replaced [0-9] with \d throughout

Test plan

  • Verify valid emails (user@example.com, user.name+tag@sub.domain.org) are accepted
  • Verify invalid inputs (notanemail, @nodomain.com, user@) are rejected
  • Confirm SonarCloud re-analysis shows 0 open issues for this file

https://claude.ai/code/session_01JTBu8cvoaXGZoY95EzTrkv


Generated by Claude Code

Replace overly complex RFC 5322 email regex (complexity 88) with a
simpler validator that uses \d instead of [0-9], has no duplicate
character class members, and stays well within the allowed complexity
limit (rules S5843, S5869, S6353).

https://claude.ai/code/session_01JTBu8cvoaXGZoY95EzTrkv
@renefritze
renefritze merged commit 69a4080 into main May 31, 2026
7 checks passed
@renefritze
renefritze deleted the claude/intelligent-fermi-BlwPV branch May 31, 2026 09:24
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

Successfully merging this pull request may close these issues.

2 participants