Skip to content

Commit 02285ce

Browse files
authored
Update README.md
1 parent 2be4376 commit 02285ce

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ $arrayReader = new ArrayReader([
5151
echo $arrayReader->getString('key1.key2.key3');
5252
```
5353

54+
## Better Code Quality
55+
56+
Converting complex data with simple PHP works by using a lot of type casting and `if` conditions etc.
57+
This leads to very high cyclomatic complexity and nesting depth, and thus poor "code rating".
58+
59+
**Before**: Conditions: 10, Paths: 512, CRAP Score: 10
60+
<details>
61+
<summary>Click to expand!</summary>
62+
<img src="https://user-images.githubusercontent.com/781074/109776592-096fcc80-7c03-11eb-95d4-6eef8fe982e2.png">
63+
</details>
64+
65+
**After**: Conditions: 1, Paths: 1, CRAP Score: 1
66+
<details>
67+
<summary>Click to expand!</summary>
68+
<img src="https://user-images.githubusercontent.com/781074/109777526-1e992b00-7c04-11eb-8e6b-04d538661f4a.png">
69+
</details>
70+
5471
## Similar libraries
5572

5673
* https://github.com/michaelpetri/typed-input

0 commit comments

Comments
 (0)