Skip to content

Conversation

@PawanMohit16
Copy link

@PawanMohit16 PawanMohit16 commented Jan 14, 2026

Proposed change

Resolves #2910

Hardens the regex used for extracting markdown list names by removing backtracking-prone constructs and bounding all quantifiers. Behavior is unchanged, but the implementation is now ReDoS-safe and scanner-compliant.

Checklist

  • I followed the contributing workflow
  • I verified that my code works as intended and resolves the issue
  • I ran make check-test locally
  • I used AI for code, documentation, tests, or communication related to this PR

Copilot AI review requested due to automatic review settings January 14, 2026 10:32
@PawanMohit16 PawanMohit16 requested a review from kasya as a code owner January 14, 2026 10:32
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

  • Refactor
    • Improved internal leader-list parsing for clearer, more maintainable logic while preserving all existing behavior and return formats. No public interface or signature changes.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Rewrote the get_leaders function in backend/apps/owasp/models/common.py: removed an unused itertools import and replaced a single complex regex approach with per-line processing using separate regexes for bracketed and starred entries plus post-processing to trim parentheticals and whitespace. No public signatures changed.

Changes

Cohort / File(s) Summary
Regex & parsing change
backend/apps/owasp/models/common.py
Removed unused itertools import. Replaced one complex regex with per-line parsing: added bracketed_pattern and a starred-entry pattern, explicit extraction for each line, and post-processing to strip trailing parenthetical info and whitespace; preserved return structure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • kasya
  • arkid15r
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: simplifying regex to reduce Sonar complexity while preserving behavior, which directly matches the PR's objectives.
Description check ✅ Passed The description clearly references the linked issue (#2910) and explains the change focuses on reducing regex complexity and making it ReDoS-safe.
Linked Issues check ✅ Passed The PR implements the objective from #2910: replacing a high-complexity regex with a simplified version that reduces Sonar complexity while preserving behavior and ensuring ReDoS safety.
Out of Scope Changes check ✅ Passed The changes are focused solely on refactoring the regex in get_leaders function and removing unused itertools import, both directly related to the #2910 objective.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🧹 Recent nitpick comments
backend/apps/owasp/models/common.py (1)

200-216: Consider moving pattern definitions outside the loop.

The implementation correctly achieves the PR objectives: bounded quantifiers (\s{0,3}, {1,200}, {0,100}) ensure ReDoS safety, and splitting the complex regex into simpler patterns reduces Sonar complexity.

For a minor performance and readability improvement, consider defining the regex patterns as module-level constants or at least outside the loop to avoid repeated string creation on each iteration:

♻️ Suggested refactor
+    BRACKETED_PATTERN = re.compile(
+        r"[-*]\s{0,3}\[\s{0,3}([^\]\(]{1,200})"
+        r"(?:\s{0,3}\([^)]{0,100}\))?\s{0,3}\]"
+    )
+    STARRED_PATTERN = re.compile(r"\*\s{0,3}([\w\s]{1,200})")
+    TRAILING_PAREN_PATTERN = re.compile(r"\s{0,3}\([^)]{0,100}\)\s{0,3}$")

     def get_leaders(self):
         """Get leaders from leaders.md file on GitHub."""
         content = get_repository_file_content(self.leaders_md_url)
         if not content:
             return []

         leaders = []
         for line in content.split("\n"):
             stripped_line = line.strip()
-            names = []
-
-            bracketed_pattern = (
-                r"[-*]\s{0,3}\[\s{0,3}([^\]\(]{1,200})"
-                r"(?:\s{0,3}\([^)]{0,100}\))?\s{0,3}\]"
-            )
-            names.extend(re.findall(bracketed_pattern, stripped_line))
-            names.extend(re.findall(r"\*\s{0,3}([\w\s]{1,200})", stripped_line))
+            names = self.BRACKETED_PATTERN.findall(stripped_line)
+            names.extend(self.STARRED_PATTERN.findall(stripped_line))

             cleaned_names = []
             for raw_name in names:
                 if raw_name.strip():
-                    cleaned = re.sub(r"\s{0,3}\([^)]{0,100}\)\s{0,3}$", "", raw_name).strip()
+                    cleaned = self.TRAILING_PAREN_PATTERN.sub("", raw_name).strip()
                     cleaned_names.append(cleaned)

             leaders.extend(cleaned_names)

         return leaders

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 632c245 and 7f3f808.

📒 Files selected for processing (1)
  • backend/apps/owasp/models/common.py
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:213-232
Timestamp: 2025-09-06T19:03:01.985Z
Learning: In the OWASP Nest project, the get_leaders_emails() method in RepositoryBasedEntityModel is designed to only capture leaders with mailto: links from leaders.md files, intentionally ignoring plain text names without email addresses. The current regex implementation works correctly for the intended behavior as validated by comprehensive test cases.
📚 Learning: 2025-09-06T19:03:01.985Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:213-232
Timestamp: 2025-09-06T19:03:01.985Z
Learning: In the OWASP Nest project, the get_leaders_emails() method in RepositoryBasedEntityModel is designed to only capture leaders with mailto: links from leaders.md files, intentionally ignoring plain text names without email addresses. The current regex implementation works correctly for the intended behavior as validated by comprehensive test cases.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-09-06T12:48:44.916Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:0-0
Timestamp: 2025-09-06T12:48:44.916Z
Learning: When migrating scraper logic to GitHub .md file parsing in the OWASP project, the new implementation should maintain the same case-sensitivity behavior as the original scraper logic, even if case-insensitive matching might seem more robust.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-12-31T05:17:39.659Z
Learnt from: kart-u
Repo: OWASP/Nest PR: 3101
File: backend/apps/common/extensions.py:92-98
Timestamp: 2025-12-31T05:17:39.659Z
Learning: In this codebase, import OperationType for GraphQL operations from the graphql-core package rather than from strawberry. Use 'from graphql import OperationType'. Strawberry re-exports via graphql-core internally, so relying on strawberry's API may be brittle. Apply this rule to all Python files that deal with GraphQL operation types; ensure imports come from graphql (graphql-core) and not from strawberry packages. This improves compatibility and avoids coupling to strawberry's internals.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2026-01-01T17:48:23.963Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2948
File: backend/apps/owasp/management/commands/owasp_generate_community_snapshot_video.py:41-47
Timestamp: 2026-01-01T17:48:23.963Z
Learning: In Django code, be aware that a QuerySet's boolean evaluation (e.g., if not queryset) runs a database query to determine emptiness. While it is technically valid to use the queryset in a boolean context, use queryset.exists() for existence checks to avoid unnecessary queries and improve performance. Applicable broadly to Python/Django files rather than just this specific path.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2026-01-01T18:57:05.007Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2948
File: backend/apps/owasp/video.py:189-215
Timestamp: 2026-01-01T18:57:05.007Z
Learning: In the OWASP backend area, maintain the established pattern: when dealing with sponsors, include all entries from Sponsor.objects.all() (including NOT_SPONSOR) and perform in-memory sorting using the same criteria/pattern used by the GraphQL sponsor query implemented in backend/apps/owasp/api/internal/queries/sponsor.py. Apply this behavior consistently to files in backend/apps/owasp (not just video.py), and ensure code paths that render sponsor lists follow this in-code sorting approach rather than pre-filtering NOT_SPONSOR entries before sorting.

Applied to files:

  • backend/apps/owasp/models/common.py
🧬 Code graph analysis (1)
backend/apps/owasp/models/common.py (1)
backend/apps/owasp/api/internal/nodes/common.py (1)
  • leaders (19-21)
🔇 Additional comments (1)
backend/apps/owasp/models/common.py (1)

203-208: LGTM on the regex patterns for ReDoS safety.

The bounded quantifiers ({0,3}, {1,200}, {0,100}) eliminate backtracking-prone constructs and satisfy ReDoS scanner requirements. The pattern logic correctly:

  • Captures bracketed names while excluding ] and ( from the capture group
  • Handles optional parenthetical suffixes within brackets
  • Captures plain asterisk-prefixed names separately

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies a complex regex pattern used to extract markdown list names from content, reducing Sonar cognitive complexity while maintaining the same functional behavior. The change improves code maintainability by making the regex more readable and removing optional capture group logic.

Changes:

  • Simplified the regex pattern from r"[-*]\s*\[\s*([^(]+?)\s*(?:\([^)]*\))?\]|\*\s*([\w\s]+)" to r"[-*]\s*\[\s*([^\]]+?)\s*\]|\*\s+([\w\s]+)"
  • Moved parenthetical removal logic outside the regex using re.sub(r"\s*\([^)]*\)\s*$", "", name).strip()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 14, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 14, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@backend/apps/owasp/models/common.py`:
- Line 203: The regex change in names.extend(...) replaced "\*\s*" with "\*\s+",
which breaks matching list items like "*Name" that have no space after the
asterisk; restore the original behavior by changing the pattern back to use
"\*\s*" (or if the intent is to require a space, add a clear comment/docstring
near the function explaining that list items must have a space after the
asterisk), and update any tests accordingly; locate the call to
names.extend(re.findall(...)) in common.py and revert the regex or add the
documentation note to the surrounding function/class.
♻️ Duplicate comments (1)
backend/apps/owasp/models/common.py (1)

202-202: Mid-string parentheticals will be retained, changing behavior.

The pattern [^\]]+ captures everything except ], including parentheses. For input like [Name (Title) (Role)]:

  • This captures Name (Title) (Role)
  • The re.sub on line 206 only removes the trailing (Role), leaving Name (Title)
  • The original [^(]+? stopped at the first (, capturing only Name

To preserve the original behavior, exclude ( from the character class:

Proposed fix
-            names.extend(re.findall(r"[-*]\s*\[\s*([^\]]+)\s*\]", stripped_line))
+            names.extend(re.findall(r"[-*]\s*\[\s*([^(\]]+)", stripped_line))
🧹 Nitpick comments (1)
backend/apps/owasp/models/common.py (1)

205-207: Consider: re.sub is a no-op for star-prefixed names.

Names from the second pattern ([\w\s]+) cannot contain parentheses, so applying re.sub to strip trailing parentheticals is unnecessary overhead for those entries. This is a minor efficiency consideration and could be addressed by tracking which pattern matched, though the current approach is simpler and works correctly.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16f76e6 and 8623dfe.

📒 Files selected for processing (1)
  • backend/apps/owasp/models/common.py
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:213-232
Timestamp: 2025-09-06T19:03:01.985Z
Learning: In the OWASP Nest project, the get_leaders_emails() method in RepositoryBasedEntityModel is designed to only capture leaders with mailto: links from leaders.md files, intentionally ignoring plain text names without email addresses. The current regex implementation works correctly for the intended behavior as validated by comprehensive test cases.
📚 Learning: 2025-09-06T19:03:01.985Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:213-232
Timestamp: 2025-09-06T19:03:01.985Z
Learning: In the OWASP Nest project, the get_leaders_emails() method in RepositoryBasedEntityModel is designed to only capture leaders with mailto: links from leaders.md files, intentionally ignoring plain text names without email addresses. The current regex implementation works correctly for the intended behavior as validated by comprehensive test cases.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-09-06T19:28:14.297Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/entity_member.py:50-56
Timestamp: 2025-09-06T19:28:14.297Z
Learning: In the OWASP/Nest project, when migrating scraper logic to GitHub .md file parsing, the sync_leaders method uses member_name as the primary identifier for finding and updating existing EntityMember records, not member_email. This approach is chosen because names are more stable identifiers in markdown files, while emails might be added/updated over time.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-12-31T05:17:39.659Z
Learnt from: kart-u
Repo: OWASP/Nest PR: 3101
File: backend/apps/common/extensions.py:92-98
Timestamp: 2025-12-31T05:17:39.659Z
Learning: In this codebase, import OperationType for GraphQL operations from the graphql-core package rather than from strawberry. Use 'from graphql import OperationType'. Strawberry re-exports via graphql-core internally, so relying on strawberry's API may be brittle. Apply this rule to all Python files that deal with GraphQL operation types; ensure imports come from graphql (graphql-core) and not from strawberry packages. This improves compatibility and avoids coupling to strawberry's internals.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2026-01-01T17:48:23.963Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2948
File: backend/apps/owasp/management/commands/owasp_generate_community_snapshot_video.py:41-47
Timestamp: 2026-01-01T17:48:23.963Z
Learning: In Django code, be aware that a QuerySet's boolean evaluation (e.g., if not queryset) runs a database query to determine emptiness. While it is technically valid to use the queryset in a boolean context, use queryset.exists() for existence checks to avoid unnecessary queries and improve performance. Applicable broadly to Python/Django files rather than just this specific path.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2026-01-01T18:57:05.007Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2948
File: backend/apps/owasp/video.py:189-215
Timestamp: 2026-01-01T18:57:05.007Z
Learning: In the OWASP backend area, maintain the established pattern: when dealing with sponsors, include all entries from Sponsor.objects.all() (including NOT_SPONSOR) and perform in-memory sorting using the same criteria/pattern used by the GraphQL sponsor query implemented in backend/apps/owasp/api/internal/queries/sponsor.py. Apply this behavior consistently to files in backend/apps/owasp (not just video.py), and ensure code paths that render sponsor lists follow this in-code sorting approach rather than pre-filtering NOT_SPONSOR entries before sorting.

Applied to files:

  • backend/apps/owasp/models/common.py
🧬 Code graph analysis (1)
backend/apps/owasp/models/common.py (1)
backend/apps/owasp/api/internal/nodes/common.py (1)
  • leaders (19-21)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@backend/apps/owasp/models/common.py`:
- Line 347: Remove the unnecessary explicit "return None" statement (the lone
"return None" in backend/apps/owasp/models/common.py) so the function relies on
Python's implicit None return; locate the function that contains the "return
None" line and delete that line, leaving the rest of the function logic
unchanged.
♻️ Duplicate comments (1)
backend/apps/owasp/models/common.py (1)

200-206: Behavioral changes from previous review remain unaddressed.

Two issues flagged in prior reviews still apply:

  1. Line 202: Using [^\]]+ instead of [^(]+? changes behavior for entries with multiple parentheticals like [Name (Title) (Role)]. The new pattern captures the entire content and only strips the trailing parenthetical, leaving Name (Title) instead of Name.

  2. Line 203: Using \*\s+ (one or more spaces) instead of the original \*\s* (zero or more) breaks matching for entries like *Name with no space after the asterisk.

Please address these or confirm the behavioral changes are intentional.

🧹 Nitpick comments (2)
backend/apps/owasp/models/common.py (2)

251-253: Consider using @staticmethod instead of the no-op assignment.

The method doesn't use instance state. A @staticmethod decorator would be cleaner than the _ = self workaround, though both achieve the linter-silencing goal.

Suggested refactor
+    `@staticmethod`
-    def get_related_url(self, url, exclude_domains=(), include_domains=()) -> str | None:
+    def get_related_url(url, exclude_domains=(), include_domains=()) -> str | None:
         """Get OWASP entity related URL."""
-        _ = self

Note: Converting to @staticmethod would require updating all call sites from self.get_related_url(...) to ClassName.get_related_url(...) or just get_related_url(...). Verify callers before applying.


306-308: Same observation: method doesn't use instance state.

parse_tags could also be a @staticmethod for the same reasons as get_related_url.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8623dfe and 79b2c28.

📒 Files selected for processing (1)
  • backend/apps/owasp/models/common.py
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:213-232
Timestamp: 2025-09-06T19:03:01.985Z
Learning: In the OWASP Nest project, the get_leaders_emails() method in RepositoryBasedEntityModel is designed to only capture leaders with mailto: links from leaders.md files, intentionally ignoring plain text names without email addresses. The current regex implementation works correctly for the intended behavior as validated by comprehensive test cases.
📚 Learning: 2025-09-06T19:03:01.985Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:213-232
Timestamp: 2025-09-06T19:03:01.985Z
Learning: In the OWASP Nest project, the get_leaders_emails() method in RepositoryBasedEntityModel is designed to only capture leaders with mailto: links from leaders.md files, intentionally ignoring plain text names without email addresses. The current regex implementation works correctly for the intended behavior as validated by comprehensive test cases.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-09-06T19:28:14.297Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/entity_member.py:50-56
Timestamp: 2025-09-06T19:28:14.297Z
Learning: In the OWASP/Nest project, when migrating scraper logic to GitHub .md file parsing, the sync_leaders method uses member_name as the primary identifier for finding and updating existing EntityMember records, not member_email. This approach is chosen because names are more stable identifiers in markdown files, while emails might be added/updated over time.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-09-06T12:48:44.916Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2223
File: backend/apps/owasp/models/common.py:0-0
Timestamp: 2025-09-06T12:48:44.916Z
Learning: When migrating scraper logic to GitHub .md file parsing in the OWASP project, the new implementation should maintain the same case-sensitivity behavior as the original scraper logic, even if case-insensitive matching might seem more robust.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-11-23T11:37:26.253Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2606
File: backend/apps/api/rest/v0/project.py:43-48
Timestamp: 2025-11-23T11:37:26.253Z
Learning: In the OWASP Nest backend, `entity_leaders` is a `property` method defined in `RepositoryBasedEntityModel` (backend/apps/owasp/models/common.py) that returns a dynamically constructed QuerySet. It cannot be prefetched using standard `prefetch_related()` because Django's prefetch mechanism only works on model fields and relations, not property methods.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2025-12-31T05:17:39.659Z
Learnt from: kart-u
Repo: OWASP/Nest PR: 3101
File: backend/apps/common/extensions.py:92-98
Timestamp: 2025-12-31T05:17:39.659Z
Learning: In this codebase, import OperationType for GraphQL operations from the graphql-core package rather than from strawberry. Use 'from graphql import OperationType'. Strawberry re-exports via graphql-core internally, so relying on strawberry's API may be brittle. Apply this rule to all Python files that deal with GraphQL operation types; ensure imports come from graphql (graphql-core) and not from strawberry packages. This improves compatibility and avoids coupling to strawberry's internals.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2026-01-01T17:48:23.963Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2948
File: backend/apps/owasp/management/commands/owasp_generate_community_snapshot_video.py:41-47
Timestamp: 2026-01-01T17:48:23.963Z
Learning: In Django code, be aware that a QuerySet's boolean evaluation (e.g., if not queryset) runs a database query to determine emptiness. While it is technically valid to use the queryset in a boolean context, use queryset.exists() for existence checks to avoid unnecessary queries and improve performance. Applicable broadly to Python/Django files rather than just this specific path.

Applied to files:

  • backend/apps/owasp/models/common.py
📚 Learning: 2026-01-01T18:57:05.007Z
Learnt from: rudransh-shrivastava
Repo: OWASP/Nest PR: 2948
File: backend/apps/owasp/video.py:189-215
Timestamp: 2026-01-01T18:57:05.007Z
Learning: In the OWASP backend area, maintain the established pattern: when dealing with sponsors, include all entries from Sponsor.objects.all() (including NOT_SPONSOR) and perform in-memory sorting using the same criteria/pattern used by the GraphQL sponsor query implemented in backend/apps/owasp/api/internal/queries/sponsor.py. Apply this behavior consistently to files in backend/apps/owasp (not just video.py), and ensure code paths that render sponsor lists follow this in-code sorting approach rather than pre-filtering NOT_SPONSOR entries before sorting.

Applied to files:

  • backend/apps/owasp/models/common.py
🧬 Code graph analysis (1)
backend/apps/owasp/models/common.py (2)
backend/apps/owasp/api/internal/nodes/common.py (1)
  • leaders (19-21)
backend/apps/mentorship/api/internal/nodes/mentor.py (1)
  • name (18-20)
🪛 Ruff (0.14.11)
backend/apps/owasp/models/common.py

347-347: Do not explicitly return None in function if it is the only possible return value

Remove explicit return None

(RET501)


347-347: Useless return statement at end of function

Remove useless return statement

(PLR1711)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 14, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 14, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 15, 2026
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert all unrelated changes.
Run make check-test locally -- just marking the checkbox is not enough.

@PawanMohit16 PawanMohit16 requested a review from arkid15r January 16, 2026 11:33
@PawanMohit16 PawanMohit16 marked this pull request as ready for review January 16, 2026 11:34
@sonarqubecloud
Copy link

Copy link
Author

@PawanMohit16 PawanMohit16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted all the unrelated changes. Based on our earlier conversation, I had run make check-test-backend for this backend-only change. I had already run it before, and I ran it again after your message as well. All good locally. Let me know if anything else is needed.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify complex regular expression to satisfy Sonar complexity rule.

2 participants