Skip to content

TCE-1383 Improve LowerCasePatternMatching rule - #88

Merged
DMarinhoCodacy merged 6 commits into
masterfrom
Improve-LowerCase-Rule
Aug 3, 2026
Merged

TCE-1383 Improve LowerCasePatternMatching rule#88
DMarinhoCodacy merged 6 commits into
masterfrom
Improve-LowerCase-Rule

Conversation

@DMarinhoCodacy

Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

While the repository's Codacy grade is 'up to standards', this PR introduces logic changes to the LowerCasePatternMatching rule without accompanying test cases or a descriptive PR summary.

A significant logic concern was identified regarding the addition of Pat.Bind: there is a high probability of generating duplicate reports for the same line because the walker likely visits both the binding and the underlying variable. Furthermore, the isCaseFromPartialFunction method has exceeded complexity thresholds, which may hinder future maintainability. These logic and quality gaps should be addressed before merging to ensure the rule remains efficient and accurate.

About this PR

  • The PR description is empty, and no new test cases were provided to verify the 'Pat.Bind' logic. This makes it difficult to validate that the new requirements are met without regression.
1 comment outside of the diff
patterns-base/src/main/scala/codacy/patterns/Custom_Scala_LowerCasePatternMatching.scala

line 25 🟡 MEDIUM RISK
The method isCaseFromPartialFunction has a cyclomatic complexity of 11, exceeding the limit of 8. Consider extracting the logic that identifies partial application patterns (lines 28-31) into a private helper method or a custom extractor.

Test suggestions

  • Missing recommended test scenario: Verify that a lowercase variable in a standard case statement is flagged.
  • Missing recommended test scenario: Verify that a lowercase variable in a binding pattern (using '@') is flagged.
  • Missing recommended test scenario: Verify that uppercase variables or variables with explicit type annotations are not flagged.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Missing recommended test scenario: Verify that a lowercase variable in a standard case statement is flagged.
2. Missing recommended test scenario: Verify that a lowercase variable in a binding pattern (using '@') is flagged.
3. Missing recommended test scenario: Verify that uppercase variables or variables with explicit type annotations are not flagged.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@DMarinhoCodacy
DMarinhoCodacy merged commit 2ce9268 into master Aug 3, 2026
4 checks passed
@DMarinhoCodacy
DMarinhoCodacy deleted the Improve-LowerCase-Rule branch August 3, 2026 11:38
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