Skip to content

Update Tool and Documentation - #82

Merged
DMarinhoCodacy merged 9 commits into
masterfrom
Update-tool-and-documentation
Aug 11, 2026
Merged

Update Tool and Documentation#82
DMarinhoCodacy merged 9 commits into
masterfrom
Update-tool-and-documentation

Conversation

@DMarinhoCodacy

Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production

codacy-production Bot commented Aug 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 2 minor

Results:
2 new issues

Category Results
Documentation 2 minor

View in Codacy

🟢 Metrics 112 complexity · 0 duplication

Metric Results
Complexity 112
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

The overhaul of the Bandit documentation generation system is currently not up to Codacy standards. While the transition to a source-extraction script improves long-term maintainability, the current implementation of the truncation logic (3-line limit) breaks documentation content, resulting in incomplete sentences and missing syntax across numerous pattern descriptions (e.g., B101, B113).

Furthermore, the new extract_docs_from_source.py script is a high-risk uncovered complex file with a cyclomatic complexity of 81. This script requires significant refactoring and the addition of unit tests to ensure the extraction process is reliable. Systemic issues regarding missing UTF-8 encoding in file operations and redundant docstring extraction in blacklist files should also be addressed before this PR is merged.

About this PR

  • There is a systemic pattern of missing explicit UTF-8 encoding when performing file I/O operations in the extraction script, which can lead to character corruption or crashes in non-UTF-8 environments.
  • No PR description was provided to explain the significant overhaul of the documentation logic, transitioning from HTML-based extraction to direct source-code parsing.

Test suggestions

  • Verify that extract_docs_from_source.py correctly parses both single-pattern plugin files and multi-pattern blacklist files.
  • Verify that the extraction script correctly maps Bandit internal severity strings (High/Medium/Low) to Codacy levels (Error/Warning/Info).
  • Verify that the 3-line truncation logic in the extraction script does not result in broken sentences or syntax errors in the documentation.
  • Implement automated unit test coverage for the extraction logic in scripts/extract_docs_from_source.py to mitigate risks associated with high cyclomatic complexity (81).
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that extract_docs_from_source.py correctly parses both single-pattern plugin files and multi-pattern blacklist files.
2. Verify that the extraction script correctly maps Bandit internal severity strings (High/Medium/Low) to Codacy levels (Error/Warning/Info).
3. Verify that the 3-line truncation logic in the extraction script does not result in broken sentences or syntax errors in the documentation.
4. Implement automated unit test coverage for the extraction logic in scripts/extract_docs_from_source.py to mitigate risks associated with high cyclomatic complexity (81).

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

Comment thread scripts/extract_docs_from_source.py Outdated
Comment thread scripts/extract_docs_from_source.py Outdated
Comment thread scripts/extract_docs_from_source.py Outdated
Comment thread scripts/extract_docs_from_source.py
Comment thread docs/description/B101.md Outdated
Comment thread scripts/extract_docs_from_source.py Outdated
Comment thread scripts/extract_docs_from_source.py Outdated
@DMarinhoCodacy
DMarinhoCodacy enabled auto-merge (squash) August 11, 2026 16:32
@DMarinhoCodacy
DMarinhoCodacy merged commit 197444d into master Aug 11, 2026
4 checks passed
@DMarinhoCodacy
DMarinhoCodacy deleted the Update-tool-and-documentation branch August 11, 2026 16:47
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