Skip to content

Fix results parser#336

Merged
DMarinhoCodacy merged 4 commits intomasterfrom
fix-pyright
Apr 9, 2026
Merged

Fix results parser#336
DMarinhoCodacy merged 4 commits intomasterfrom
fix-pyright

Conversation

@DMarinhoCodacy
Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 9, 2026

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. 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

The PR aims to improve the robustness of the prospector results parser by isolating JSON content within tool output. However, the current implementation fails to meet its own robustness goals: it is vulnerable to runtime crashes (KeyError or TypeError) if the tool output is valid JSON but does not follow the expected schema (e.g., missing the 'messages' key).

Crucially, no tests were added to verify the new logic or the edge cases it intends to handle. While Codacy reports the PR as up to standards, the lack of verification and the identified logic gaps should prevent merging in its current state.

About this PR

  • No unit tests were included to verify the new parsing logic. Given the complexity of manually extracting substrings from tool output, automated verification of edge cases (like malformed JSON or unexpected schemas) is required.
  • The PR lacks a description or Jira ticket, providing no context for the specific failures this change is intended to address.

Test suggestions

  • Parse tool output containing leading/trailing warnings or banners around the JSON payload.
  • Parse tool output that contains no curly braces (non-JSON output).
  • Parse tool output where extracted text between braces is syntactically invalid JSON.
  • Parse valid JSON object that is missing the 'messages' key.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Parse tool output containing leading/trailing warnings or banners around the JSON payload.
2. Parse tool output that contains no curly braces (non-JSON output).
3. Parse tool output where extracted text between braces is syntactically invalid JSON.
4. Parse valid JSON object that is missing the 'messages' key.

🗒️ Improve review quality by adding custom instructions

Comment thread src/codacy_prospector.py Outdated
@DMarinhoCodacy DMarinhoCodacy merged commit cce1cca into master Apr 9, 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