Open rbratfors opened 4 years ago
case DEFAULT:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case WARNING:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case WAREHOUSE_CAPACITY:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case FOREIGN_DIPLOMACY:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case MARKET_PRICES:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case MISSING_GOODS:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case TUTORIAL:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
case GIFT_GOODS:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
default:
CodeCoverage.run("getDefaultDisplay");
doIf = true;
break;
Here's the code in question. Every one of these cases can be removed since they do the same thing as default.
This function has a switch statement with a lot of "fall through" cases, i.e. cases without breaks. There's as many as 8 of these that fall through to the default which is a very interesting design choice.
The code complexity of the function can be reduced some by just deleting all of those cases and letting them default to default instead.