一些SAP UI5代码审查的例子

101 阅读1分钟

目录:

clipboard1

1. Group id decrease

Why the group id for com.sap.fiori is decreased from 1.5.6 to 1.5.1?

clipboard2

2. Best practice for constant definition

这个涉及到JavaScript里定义常量的最佳实践。

clipboard3

  1. Where is this oVersioningModel used?

clipboard4

I cannot search any other used list for oVersioningModel in S3.controller.js

4. What does backend 5 mean?

这个注释写得不太好,让人看不懂

clipboard5

5. Does this 8 mean wave8?

这个变量名里的8也让人费解。

clipboard6

6. Wrong comment

clipboard7

7. Code format

虽然这不是我们写的,但是看着难受。
作为一个强迫症患者,Jerry能表示这段代码看起来很难受。

clipboard8

而且单步调试特别不方便:

clipboard9

8. Unused parameter index

下面这个index参数实际上没有用到。

clipboard10

9. Return false to terminate the loop inside jQuery.each.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":