Skip to content

fix: clear remaining Codacy findings#38

Merged
JE-Chen merged 2 commits intomainfrom
dev
Apr 25, 2026
Merged

fix: clear remaining Codacy findings#38
JE-Chen merged 2 commits intomainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented Apr 25, 2026

Summary

  • Validate package names with a strict module-identifier regex before find_spec / import_module in PackageManager.check_package so user-controlled inputs cannot trigger dynamic import of arbitrary modules (Semgrep non-literal-import).
  • Switch docs/source/conf.py to Sphinx's project_copyright alias to stop shadowing the copyright builtin (Pylint W0622).
  • Remove 5 unused imports flagged by Prospector pyflakes across test_executor.py, test_get_dir_file_list.py, and test_json_file.py.

Test plan

  • pytest — 55/55 passing locally
  • Codacy issue count drops to 0 on the next scan
  • SonarCloud quality gate stays green

- Validate package names against a strict module-identifier regex
  before find_spec/import_module so user-controlled inputs cannot
  reach dynamic import (Semgrep non-literal-import).
- Use Sphinx project_copyright instead of redefining the copyright
  builtin in docs/source/conf.py (Pylint W0622).
- Drop unused imports flagged by Prospector pyflakes in
  test_executor, test_get_dir_file_list, and test_json_file.
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 25, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Semgrep flagged the compiled regex as a potential ReDoS pattern.
Validating each dotted segment with str.isidentifier gives the
same guarantee against shell/path payloads without any regex,
removing the heuristic warning and reading more directly.
@sonarqubecloud
Copy link
Copy Markdown

@JE-Chen JE-Chen merged commit 15b95df into main Apr 25, 2026
26 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.

1 participant