Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0027432 | Openbravo ERP | A. Platform | public | 2014-08-23 13:28 | 2016-06-28 16:06 |
|
Reporter | shuehner | |
Assigned To | Sanjota | |
Priority | normal | Severity | trivial | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR16Q3 | |
Merge Request Status | |
Review Assigned To | aferraz |
OBNetwork customer | No |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0027432: Cleanup unused variables in pl-functions & triggers |
Description | There are quite a few variables declared in in pl-functions & -triggers which are never used.
Those should be cleaned up.
Note: found using static analysis using plpgsql_check |
Steps To Reproduce | Run plpgsql_check_function on all functions + trigger
And review output.
|
Proposed Solution | Delete the unused variables. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0030720 | | closed | shuehner | Cleanup unused variables in pl-functions & triggers (platform part) | related to | defect | 0033422 | | closed | Sanjota | Static code analysis: triggers |
|
Attached Files | 27432_v2.hgexport (65,500) 2015-09-02 10:12 https://issues.openbravo.com/file_download.php?file_id=8411&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2014-08-23 13:28 | shuehner | New Issue | |
2014-08-23 13:28 | shuehner | Assigned To | => shuehner |
2014-08-23 13:28 | shuehner | OBNetwork customer | => No |
2014-08-23 13:28 | shuehner | Modules | => Core |
2014-08-23 13:28 | shuehner | Triggers an Emergency Pack | => No |
2015-08-26 19:58 | shuehner | File Added: 27432.hgexport | |
2015-09-01 16:22 | shuehner | Issue cloned | 0030720 |
2015-09-01 16:22 | shuehner | Relationship added | related to 0030720 |
2015-09-02 10:05 | shuehner | Note Added: 0080010 | |
2015-09-02 10:12 | shuehner | File Added: 27432_v2.hgexport | |
2015-09-02 10:12 | shuehner | File Deleted: 27432.hgexport | |
2015-09-02 10:12 | shuehner | Note Added: 0080012 | |
2016-06-06 18:36 | aferraz | Assigned To | shuehner => Sanjota |
2016-06-13 17:33 | Sanjota | Note Added: 0087206 | |
2016-06-13 17:37 | Sanjota | Note Edited: 0087206 | bug_revision_view_page.php?bugnote_id=0087206#r12356 |
2016-06-14 11:09 | Sanjota | Note Edited: 0087206 | bug_revision_view_page.php?bugnote_id=0087206#r12363 |
2016-06-14 12:03 | Sanjota | Note Edited: 0087206 | bug_revision_view_page.php?bugnote_id=0087206#r12368 |
2016-06-27 16:45 | Sanjota | Status | new => scheduled |
2016-06-28 09:52 | hgbot | Checkin | |
2016-06-28 09:52 | hgbot | Note Added: 0088005 | |
2016-06-28 09:52 | hgbot | Status | scheduled => resolved |
2016-06-28 09:52 | hgbot | Resolution | open => fixed |
2016-06-28 09:52 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/a8a6d8bd52e5bc439abf179aa9d6166c4ec11258 [^] |
2016-06-28 09:52 | hgbot | Checkin | |
2016-06-28 09:52 | hgbot | Note Added: 0088006 | |
2016-06-28 09:57 | aferraz | Note Added: 0088007 | |
2016-06-28 12:53 | aferraz | Note Edited: 0088007 | bug_revision_view_page.php?bugnote_id=0088007#r12548 |
2016-06-28 12:56 | aferraz | Review Assigned To | => aferraz |
2016-06-28 12:56 | aferraz | Note Added: 0088046 | |
2016-06-28 12:56 | aferraz | Status | resolved => closed |
2016-06-28 12:56 | aferraz | Fixed in Version | => 3.0PR16Q3 |
2016-06-28 16:06 | hudsonbot | Checkin | |
2016-06-28 16:06 | hudsonbot | Note Added: 0088057 | |
2016-06-28 16:06 | hudsonbot | Checkin | |
2016-06-28 16:06 | hudsonbot | Note Added: 0088058 | |
2016-07-05 10:21 | Sanjota | Relationship added | related to 0033422 |
Notes |
|
|
Notes for review:
All cases have been found by plpgsql_check static analysis tool but then also manually verified by checking the .xml source file in an editor.
And for each case search for the allegedly unused variable in all file to verify it is not used at all
That same procedure can be used to verify that the deleted variables are in fact not used.
NOTE: search must be done case-insensitive as pl does allow that when using variables. |
|
|
|
Updated attachment to track the remaining ones not already fixed in 30720 |
|
|
(0087206)
|
Sanjota
|
2016-06-13 17:33
(edited on: 2016-06-14 12:03) |
|
Test Plan:
Found datatype bug using static analysis using plpgsql_check and fixed the same.
Removed unused variables and changed datatype mismatches.
Note: There are few variables which are used in the same function but the tool display as unused variables. Following are the list for same.
1)c_commission_process :unused variable "type_ref"
2)c_invoice_post :unused variable "v_processed"
3)c_yearperiods :unused variable "v_monthno"
4)m_inout_post :unused variable "v_qtyaux"
5)m_pricelist_create :relation "c_temp_selection" does not exist
Query: DELETE FROM C_TEMP_Selection
6)ad_org_chk_doc_payments :unused variable "type_ref"
7)ad_org_chk_documents :unused variable "type_ref"
|
|
|
(0088005)
|
hgbot
|
2016-06-28 09:52
|
|
Repository: erp/devel/pi
Changeset: a8a6d8bd52e5bc439abf179aa9d6166c4ec11258
Author: Sanjota <sanjota.nelagi <at> promantia.com>
Date: Mon Jun 13 20:23:15 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/a8a6d8bd52e5bc439abf179aa9d6166c4ec11258 [^]
Fixes issue 27432: Cleanup unused variables in pl-functions & triggers
There are quite a few variables declared in in pl-functions & -triggers which are never used, found using static analysis using plpgsql_check. Clean those variables
---
M src-db/database/model/functions/A_ASSET_CREATE.xml
M src-db/database/model/functions/A_ASSET_POST.xml
M src-db/database/model/functions/C_AGING_GET_SCOPE.xml
M src-db/database/model/functions/C_BANKSTATEMENT_POST.xml
M src-db/database/model/functions/C_BP_GROUP_ACCT_COPY.xml
M src-db/database/model/functions/C_CASH_POST.xml
M src-db/database/model/functions/C_CHANGEPROJECTSTATUS.xml
M src-db/database/model/functions/C_CHANGEPROJECTSTATUSTOORDER.xml
M src-db/database/model/functions/C_CLOSEPROJECT.xml
M src-db/database/model/functions/C_CURRENCY_CONVERT.xml
M src-db/database/model/functions/C_CURRENCY_CONVERT_RATE.xml
M src-db/database/model/functions/C_CURRENCY_RATE.xml
M src-db/database/model/functions/C_DB_PERCENTAGE_PAID.xml
M src-db/database/model/functions/C_DP_MANAGEMENT_POST.xml
M src-db/database/model/functions/C_GENERATEPOFROMPROJECT.xml
M src-db/database/model/functions/C_GENERATESOFROMPROJECT.xml
M src-db/database/model/functions/C_GENERATESOFROMPROJECTPHASE.xml
M src-db/database/model/functions/C_GET_IBAN_DISPLAYED_ACCOUNT.xml
M src-db/database/model/functions/C_GET_NET_PRICE_FROM_GROSS.xml
M src-db/database/model/functions/C_INVOICELINETAX_INSERT.xml
M src-db/database/model/functions/C_INVOICELINETAX_ROUNDING.xml
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/C_ORDERLINETAX_INSERT.xml
M src-db/database/model/functions/C_ORDERLINETAX_ROUNDING.xml
M src-db/database/model/functions/C_ORDER_POST1.xml
M src-db/database/model/functions/C_ORDER_PO_CREATE.xml
M src-db/database/model/functions/C_PAYINADVANCE_CREATE.xml
M src-db/database/model/functions/C_PERIOD_PROCESS.xml
M src-db/database/model/functions/C_PROJECT_GENERATE.xml
M src-db/database/model/functions/C_REMITTANCE_POST.xml
M src-db/database/model/functions/C_SETTLEMENT_POST.xml
M src-db/database/model/functions/C_TAXPAYMENT_POST.xml
M src-db/database/model/functions/C_TAX_GET_LEVEL.xml
M src-db/database/model/functions/C_VALIDCOMBINATION_CLONE.xml
M src-db/database/model/functions/FACT_ACCT_RESET.xml
M src-db/database/model/functions/MA_COPY_VERSION.xml
M src-db/database/model/functions/MA_GLOBALUSE_DISTRIBUTE.xml
M src-db/database/model/functions/MA_MAINTENANCE_SCHEDULE.xml
M src-db/database/model/functions/MA_MEASURE_SHIFT_EXPLODE.xml
M src-db/database/model/functions/MA_MEASURE_TIME_EXPLODE.xml
M src-db/database/model/functions/MA_PC_CASE_CREATE.xml
M src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml
M src-db/database/model/functions/MA_PRODUCTION_COST.xml
M src-db/database/model/functions/MA_PRODUCTION_COST_GENERATE.xml
M src-db/database/model/functions/MA_STANDARD_COST_SEQUENCE.xml
M src-db/database/model/functions/MRP_PROCESSPLAN.xml
M src-db/database/model/functions/MRP_PROCESSPLAN_PLAN.xml
M src-db/database/model/functions/MRP_PROCESSPLAN_RECALCULATE.xml
M src-db/database/model/functions/MRP_PROCESSPLAN_RECALCULATE0.xml
M src-db/database/model/functions/MRP_PRODUCTION_RUN.xml
M src-db/database/model/functions/MRP_PURCHASEORDER.xml
M src-db/database/model/functions/MRP_PURCHASEPLAN.xml
M src-db/database/model/functions/MRP_PURCHASE_RUN.xml
M src-db/database/model/functions/MRP_REQUISITION.xml
M src-db/database/model/functions/MRP_RUN_EXPLODE.xml
M src-db/database/model/functions/MRP_RUN_INITIALIZE.xml
M src-db/database/model/functions/MRP_WORKREQUIREMENT.xml
M src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
M src-db/database/model/functions/M_GENERATE_STANDARD_COSTS.xml
M src-db/database/model/functions/M_GET_OFFERS_NAME.xml
M src-db/database/model/functions/M_GET_PARETO_ABC.xml
M src-db/database/model/functions/M_GET_PARETO_ABC_LEGACY.xml
M src-db/database/model/functions/M_GET_STOCK.xml
M src-db/database/model/functions/M_GET_STOCK_PARAM.xml
M src-db/database/model/functions/M_INOUTEXPLODEBOMNOTSTOCK.xml
M src-db/database/model/functions/M_INOUT_CANCEL.xml
M src-db/database/model/functions/M_INOUT_CREATE.xml
M src-db/database/model/functions/M_INOUT_CREATEINVOICE.xml
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml
M src-db/database/model/functions/M_INVENTORY_POST.xml
M src-db/database/model/functions/M_MOVEMENT_POST.xml
M src-db/database/model/functions/M_RAPPEL_INVOICE_CREATE.xml
M src-db/database/model/functions/M_REQUISITION_CREATEPO.xml
M src-db/database/model/functions/M_RESERVATION_REALLOCATE.xml
M src-db/database/model/functions/M_UNIQUELOCATOR_RULE.xml
M src-db/database/model/functions/M_UNIQUELOCATOR_RULE_PARAM.xml
M src-db/database/model/functions/M_UPDATE_PARETO_PRODUCT.xml
M src-db/database/model/functions/M_UPDATE_PARETO_PRODUCT_LEGACY.xml
M src-db/database/model/functions/S_TIMEEXPENSE_POST.xml
---
|
|
|
(0088006)
|
hgbot
|
2016-06-28 09:52
|
|
Repository: erp/devel/pi
Changeset: a3c288cd3d2fc4c1eaec67cb2f98dde321d36e42
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Jun 27 18:59:29 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a3c288cd3d2fc4c1eaec67cb2f98dde321d36e42 [^]
Related to issue 27432: Code review improvements
---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/C_PROJECT_GENERATE.xml
M src-db/database/model/functions/C_YEARPERIODS.xml
M src-db/database/model/functions/M_COPY_PRODUCT_TEMPLATE.xml
M src-db/database/model/functions/M_INOUT_POST.xml
---
|
|
|
(0088007)
|
aferraz
|
2016-06-28 09:57
(edited on: 2016-06-28 12:53) |
|
After code review, query still retrieving following results:
- ad_org_chk_doc_payments: warning:00000:24:DECLARE:unused variable "type_ref"
- ad_org_chk_documents: warning:00000:24:DECLARE:unused variable "type_ref"
- c_commission_process: warning:00000:175:DECLARE:unused variable "type_ref"
- m_pricelist_create: error:42P01:171:SQL statement:relation "c_temp_selection" does not exist
- m_pricelist_create: Query: DELETE FROM C_TEMP_Selection
- m_pricelist_create: --
|
|
|
|
|
|
|
|
|
|
|