Skip to content

Commit

Permalink
加入Cyclomatic 复杂性的维基百科链接
Browse files Browse the repository at this point in the history
  • Loading branch information
oa414 committed Jul 16, 2015
1 parent b3bf6a6 commit e65e719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ if ([someObject boolValue] == NO) { ...

## 黄金大道

当编写条件语句的时候,左边的代码间距应该是一个“黄金”或者“快乐”的大道。 这是说,不要嵌套 `if` 语句。多个 return 语句是 OK 的。这样可以避免 Cyclomatic 复杂性,并且让代码更加容易阅读。因为你的方法的重要部分没有嵌套在分支上,你可以很清楚地找到相关的代码。
当编写条件语句的时候,左边的代码间距应该是一个“黄金”或者“快乐”的大道。 这是说,不要嵌套 `if` 语句。多个 return 语句是 OK 的。这样可以避免 Cyclomatic 复杂性 (译者注: <https://en.wikipedia.org/wiki/Cyclomatic_complexity>),并且让代码更加容易阅读。因为你的方法的重要部分没有嵌套在分支上,你可以很清楚地找到相关的代码。

**推荐:**

Expand Down

0 comments on commit e65e719

Please sign in to comment.