Created
January 2, 2018 08:38
-
-
Save SunXiaoShan/5b66244270ac6aa9bb8866d985ebf45f to your computer and use it in GitHub Desktop.
OCLintSample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // unused variable | |
| int hello = 999; | |
| // short variable name | |
| int a = 1; | |
| // long variable name | |
| int a0123456789b0123456789c0123456789d0123456789e0123456789f0123456789g0123456789h0123456789i0123456789j0123456789k0123456789k0123456789l0123456789m0123456789n0123456789o0123456789p0123456789q0123456789r0123456789s0123456789t0123456789u0123456789v0123456789w0123456789x0123456789y0123456789z0123456789 = 123; | |
| // high cyclomatic complexity | |
| // deep nested block | |
| - (void)exampleHighCyclomaticComplexity { // 1 | |
| int a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=9, j=10, k=11; | |
| if (a <= b) { // 2 | |
| if (b <= c) { // 3 | |
| if (c <= d) { // 4 | |
| if (d <= e) { // 5 | |
| if (e <= f) { // 6 | |
| if (f <= g) { // 7 | |
| if (g <= h) { // 8 | |
| if (h <= i) { // 9 | |
| if (i <= j) { // 10 | |
| if (j <= k) { // 11 | |
| NSLog(@"exampleHighCyclomaticComplexity"); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment