在SAP Spartacus的convertor函数里,直接修改输入参数target的值,会有什么问题
問題:
While it is technically correct to assign to parameters from within function bodies, it reduces code readability because developers won’t be able to tell whether the original parameter or some temporary variable is being accessed without going through the whole function. Moreover, some developers might also expect assignments of function parameters to be visible to callers, which is not the case, and this lack of visibility could confuse them. Instead, all parameters, caught exceptions, and foreach parameters should be treated as constants.
SonarCloud報錯:
solution
總結
以上是生活随笔為你收集整理的在SAP Spartacus的convertor函数里,直接修改输入参数target的值,会有什么问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 吉利汽车 2022 ESG 报告:纯电动
- 下一篇: 英雄联盟SN战队成员2021