fix(scanner): address LSP violation and magic number issues#6
Merged
Conversation
1. LSP violation fix: Add source_str parameter to _walk() in base class so NetworkExfilRule can properly implement the abstract method instead of needing a separate _walk_with_source() workaround. 2. Magic number fix: Extract MOCK_CHECKSUM constant for the SHA-256 hex digest length (64 chars) in test fixtures. All 175 tests pass. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Owner
Author
Code Review ResultsNo issues found. All code changes in this PR meet the quality threshold. The fixes properly address:
✅ Ready to merge. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NetworkExfilRuleby addingsource_strparameter to base class_walk()MOCK_CHECKSUMconstant for magic number in test fixturesChanges
LSP Violation Fix
The
NetworkExfilRulepreviously had an empty_walk()stub and used a separate_walk_with_source()method, violating Liskov Substitution Principle.Fix: Add
source_stras a parameter to the base class_walk()signature:# noqa: ARG002Magic Number Fix
Extracted
MOCK_CHECKSUM = "a" * 64constant intests/conftest.pywith a comment explaining it represents SHA-256 hex digest length.Test plan
🤖 Generated with Claude Code