Skip to content

fix: resolve semgrep findings, add type hints to whitelisted, and remove f-string#1264

Draft
Nihantra-Patel wants to merge 4 commits into
frappe:developfrom
Nihantra-Patel:fix/semgrep-security-vulnerabilities
Draft

fix: resolve semgrep findings, add type hints to whitelisted, and remove f-string#1264
Nihantra-Patel wants to merge 4 commits into
frappe:developfrom
Nihantra-Patel:fix/semgrep-security-vulnerabilities

Conversation

@Nihantra-Patel

Copy link
Copy Markdown
Member
  • Add type hints to whitelisted/framework API methods
  • Convert SQL string queries (.format/f-string) to frappe.qb
  • Add frappe.has_permission checks to whitelisted methods that write data
  • Replace raw SQL aggregate/arithmetic field strings in get_all/get_value with dict aggregate syntax and frappe.qb
  • Declare [tool.bench.frappe-dependencies] (frappe, erpnext) in pyproject.toml
  • Remove redundant setup.py (build uses flit_core via pyproject.toml)

@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.09302% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.64%. Comparing base (6c6d498) to head (69b126c).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
..._loan_securities/top_10_pledged_loan_securities.py 0.00% 14 Missing ⚠️
...eport/past_cashflow_report/past_cashflow_report.py 83.33% 2 Missing ⚠️
..._origination_settings/loan_origination_settings.py 0.00% 2 Missing ⚠️
lending/api.py 0.00% 1 Missing ⚠️
...ement/doctype/loan_application/loan_application.py 80.00% 1 Missing ⚠️
...ng/loan_management/doctype/loan_repayment/utils.py 0.00% 1 Missing ⚠️
..._management/doctype/loan_transfer/loan_transfer.py 0.00% 1 Missing ⚠️
..._exposure/applicant_wise_loan_security_exposure.py 93.75% 1 Missing ⚠️
...ng/loan_origination/doctype/loan_lead/loan_lead.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1264      +/-   ##
===========================================
- Coverage    81.69%   81.64%   -0.05%     
===========================================
  Files          155      154       -1     
  Lines        10641    10667      +26     
===========================================
+ Hits          8693     8709      +16     
- Misses        1948     1958      +10     
Files with missing lines Coverage Δ
lending/hooks.py 100.00% <100.00%> (ø)
lending/loan_management/doctype/loan/loan.py 72.10% <100.00%> (+0.06%) ⬆️
...doctype/loan_accrual_repost/loan_accrual_repost.py 0.00% <ø> (ø)
...an_management/doctype/loan_partner/loan_partner.py 25.60% <100.00%> (+0.60%) ⬆️
...an_management/doctype/loan_product/loan_product.py 78.94% <100.00%> (ø)
...anagement/doctype/loan_repayment/loan_repayment.py 81.52% <100.00%> (ø)
..._management/doctype/loan_security/loan_security.py 59.09% <100.00%> (ø)
...doctype/loan_security_price/loan_security_price.py 91.89% <100.00%> (+0.22%) ⬆️
...loan_security_shortfall/loan_security_shortfall.py 84.00% <100.00%> (ø)
...eport/loan_security_status/loan_security_status.py 100.00% <100.00%> (ø)
... and 10 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants