Skip to content

Commit 08670ed

Browse files
aksOpsclaude
andcommitted
Fix 3 SonarCloud reliability bugs
- grpc_service.py: Remove redundant non-capturing group in regex - spring_events.py: Remove redundant regex alternatives already covered by \w*Event - file_discovery.py: Remove unreachable dead code after return statement Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c6f7266 commit 08670ed

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/osscodeiq/detectors/java/grpc_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# Method override pattern (simpler)
4141
_METHOD_RE = re.compile(
42-
r"(?:public)\s+(?:void|[\w<>\[\]]+)\s+(\w+)\s*\(\s*(\w+)"
42+
r"public\s+(?:void|[\w<>\[\]]+)\s+(\w+)\s*\(\s*(\w+)"
4343
)
4444

4545

src/osscodeiq/detectors/java/spring_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
r"(?:new\s+(\w+)|(\w+))"
2323
)
2424
_METHOD_PARAM_RE = re.compile(r"(?:public|protected|private)?\s*\w+\s+(\w+)\s*\(\s*(\w+)\s+\w+\)")
25-
_EVENT_CLASS_RE = re.compile(r"class\s+(\w+)\s+extends\s+(?:ApplicationEvent|AbstractEvent|\w*Event)")
25+
_EVENT_CLASS_RE = re.compile(r"class\s+(\w+)\s+extends\s+\w*Event")
2626

2727

2828
class SpringEventsDetector:

src/osscodeiq/discovery/file_discovery.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def _compute_sha256(file_path: Path) -> str:
216216
from osscodeiq.cache.hasher import hash_file
217217

218218
return hash_file(file_path)
219-
return h.hexdigest()
220219

221220

222221
class FileDiscovery:

0 commit comments

Comments
 (0)