Skip to content

Bump Prospector 1.18.0#334

Merged
DMarinhoCodacy merged 14 commits intomasterfrom
fix-issue-with-configuration-files
Apr 8, 2026
Merged

Bump Prospector 1.18.0#334
DMarinhoCodacy merged 14 commits intomasterfrom
fix-issue-with-configuration-files

Conversation

@DMarinhoCodacy
Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 7, 2026

Up to standards ✅

🟢 Issues 4 minor

Results:
4 new issues

Category Results
CodeStyle 4 minor

View in Codacy

🟢 Metrics 0 complexity · -1 duplication

Metric Results
Complexity 0
Duplication -1

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. Give us feedback

Copy link
Copy Markdown

@codacy-production codacy-production bot 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

While the PR is technically 'up to standards' according to Codacy, it introduces a logic error and increases function complexity beyond acceptable limits. Specifically, the 'readConfiguration' function now exceeds the cyclomatic complexity threshold (11 > 10), making it harder to maintain.

A critical logic issue was identified where the configuration parser may raise a 'TypeError' if the 'patterns' key is present but null, which would cause the tool to fall back to default settings unexpectedly. Furthermore, the PR lacks any description or linked Jira ticket, and most importantly, it does not include unit tests to verify the behavior change for empty patterns lists. These issues should be addressed before merging.

About this PR

  • No unit tests were included in the PR to verify the logic change or prevent regressions in configuration parsing.
  • The change in logic means that an empty patterns list now results in empty options, whereas previously it would have led to disabling all default tools. This is a significant behavior change for edge-case configurations.
  • The PR lacks a description and a Jira ticket, providing no context on why this specific change was necessary or what bug it fixes.

Test suggestions

  • Configuration has a 'prospector' tool entry with an empty 'patterns' array
  • Configuration has a 'prospector' tool entry with a non-empty 'patterns' array
  • Configuration has a 'prospector' tool entry but is missing the 'patterns' key
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Configuration has a 'prospector' tool entry with an empty 'patterns' array
2. Configuration has a 'prospector' tool entry with a non-empty 'patterns' array
3. Configuration has a 'prospector' tool entry but is missing the 'patterns' key

🗒️ Improve review quality by adding custom instructions

Comment thread src/codacy_prospector.py Outdated
@DMarinhoCodacy DMarinhoCodacy changed the title Fix issue with configuration files Bump Prospector 1.18.0 Apr 7, 2026
@DMarinhoCodacy DMarinhoCodacy merged commit 13e7676 into master Apr 8, 2026
5 checks passed
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