Created
July 25, 2013 11:54
-
-
Save WonderBeat/6078981 to your computer and use it in GitHub Desktop.
Cyclomatic complexyty by 2.10 chackstyle
This file contains 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
public class Main { | |
/** | |
* 7 | |
**/ | |
public static int method_got7(int a) { | |
switch(a) { | |
case 1: return 2; | |
case 2: return 3; | |
case 3: return 4; | |
case 4: return 5; | |
case 5: return 1; | |
case 6: return 3; | |
} | |
return 3; | |
} | |
/** | |
* 4 | |
**/ | |
public static int method_got4(int a) { | |
switch(a) { | |
case 1: | |
case 2: | |
case 3: return 1; | |
default: return 3; | |
} | |
} | |
/** | |
* 4 | |
**/ | |
public static int methodA_got4(int a) { | |
if (a == 1 || a == 2 || a == 3) { | |
return 5; | |
} else { | |
return 6; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment