I have been trying to learn how to reduce cyclomatic complexity. I have here 5 or more conditional checks inside a if statement e.g
if(something1() && something2() && something3() && something4() && something5()){
doThatThing();
}else{
doThisThing();
}
The cyclomatic complexity of the above snippet is 6 (5 condition +1 if). I know use of Enum and Chain of Responsibilty which is used to refactor multiple if else. But, here I have only 1 if else where conditions can be many.
How to refactor the above code to reduce cyclomatic complexity since in real scenario I may have a maximum of 7 conditions.
According to Clean Code by Robert C. Martin, page 301 it's a general smell:
Like @tgdavies is suggesting extract a function: