Skip to content

程式碼掃描

來源:程式碼掃描

摘要結論

  • 自訂外掛發現 20 個程式缺陷(Bug),可能導致非預期行為

共 1 項 / 1 中

程式缺陷

  • 問題:自訂外掛發現 20 個程式缺陷(Bug),可能導致非預期行為
  • 原因:程式碼邏輯錯誤或未處理的邊界條件
  • 建議:依 SonarQube 報告修復 bugs
  • 影響:此項影響等級:中
  • 驗收:Bugs = 0

掃描摘要

指標數量處理優先
安全漏洞 (Vulnerability)0立即
程式缺陷 (Bug)20短期
安全熱點 (Security Hotspot)0審查
程式碼異味 (Code Smell)137長期

問題明細

newebpay(14 個問題)

嚴重度規則訊息檔案
MAJORWeb:S5256Add "<th>" headers to this "<table>".wp-content/plugins/newebpay/class-newebpay.php:213
MINORphp:S1784Explicitly mention the visibility of this method "init_form_fields".wp-content/plugins/newebpay/class-newebpay.php:98
MINORphp:S1784Explicitly mention the visibility of this method "get_newebpay_args".wp-content/plugins/newebpay/class-newebpay.php:312
MINORphp:S1784Explicitly mention the visibility of this method "thankyou_page".wp-content/plugins/newebpay/class-newebpay.php:327
MINORphp:S1784Explicitly mention the visibility of this method "curl_work".wp-content/plugins/newebpay/class-newebpay.php:792
MINORphp:S1784Explicitly mention the visibility of this method "electronic_invoice".wp-content/plugins/newebpay/class-newebpay.php:821
MINORphp:S1784Explicitly mention the visibility of this method "receive_response".wp-content/plugins/newebpay/class-newebpay.php:1127
MINORphp:S1784Explicitly mention the visibility of this method "generate_newebpay_form".wp-content/plugins/newebpay/class-newebpay.php:1246
MINORphp:S1784Explicitly mention the visibility of this method "receipt_page".wp-content/plugins/newebpay/class-newebpay.php:1267
MINORphp:S1784Explicitly mention the visibility of this method "process_payment".wp-content/plugins/newebpay/class-newebpay.php:1279
MINORphp:S1784Explicitly mention the visibility of this method "payment_fields".wp-content/plugins/newebpay/class-newebpay.php:1298
MINORphp:S1784Explicitly mention the visibility of this method "check_newebpay_response".wp-content/plugins/newebpay/class-newebpay.php:1303
MINORphp:S1784Explicitly mention the visibility of this method "electronic_invoice_fields".wp-content/plugins/newebpay/class-newebpay.php:1312
MINORphp:S1784Explicitly mention the visibility of this method "electronic_invoice_fields_update_order_meta".wp-content/plugins/newebpay/class-newebpay.php:1547

ctkpro-invoice(6 個問題)

嚴重度規則訊息檔案
MAJORWeb:S5256Add "<th>" headers to this "<table>".wp-content/plugins/ctkpro-invoice/app/Controllers/InvoiceController.php:38
MAJORphp:S836Review the data-flow - use of uninitialized value.wp-content/plugins/ctkpro-invoice/app/Models/BankPro.php:53
MAJORphp:S1145Remove this "if" statement.wp-content/plugins/ctkpro-invoice/app/Services/InvoiceService.php:73
MAJORWeb:PageWithoutTitleCheckAdd a <title> tag to this page.wp-content/plugins/ctkpro-invoice/public/admin/ctk-invoice-plugin-page.php:9
MINORphp:S1784Explicitly mention the visibility of this method "add_admin_capabilities".wp-content/plugins/ctkpro-invoice/app/Controllers/PermissionController.php:13
MINORphp:S2003Replace "require" with "require_once".wp-content/plugins/ctkpro-invoice/ctkpro-invoice.php:19

操作方式

步驟動作負責
1依上表逐檔修復 CRITICAL/BLOCKER開發
2修復 MAJOR Bug開發
3審查 Security Hotspot 確認是否為實際漏洞開發
4重跑 SonarQube 驗證維運

驗收

重跑 SonarQube 掃描,Vulnerabilities = 0,Bugs 持續下降。