@@ -39,9 +39,8 @@ public class CppcheckCommand extends AbstractCppcheckCommand {
3939 private final static String ERROR_FORMAT = "{file}" + DELIMITER + "{line}"
4040 + DELIMITER + "{severity}" + DELIMITER + "{id}" + DELIMITER
4141 + "{message}" ;
42- private final static String SAFETY_OFF = "--premium=safety-off" ;
4342 private final static String [] DEFAULT_ARGUMENTS = { "--template="
44- + ERROR_FORMAT , SAFETY_OFF };
43+ + ERROR_FORMAT };
4544
4645 /**
4746 * pattern recognizes "2/2 files checked 100% done"
@@ -62,6 +61,9 @@ public class CppcheckCommand extends AbstractCppcheckCommand {
6261
6362
6463 private void addPremiumChecks (IPreferenceStore settingsStore ) {
64+
65+ arguments .add ("--premium=safety-off" );
66+
6567 if (settingsStore .getBoolean (IPreferenceConstants .P_PREMIUM_BUG_HUNTING )) {
6668 arguments .add ("--premium=bughunting" );
6769 }
@@ -91,7 +93,7 @@ private void addPremiumChecks(IPreferenceStore settingsStore) {
9193 /**
9294 * For testing purposes either use interfaces or simple types as parameters.
9395 * No dependency to Eclipse classes allowed.
94- *
96+ *
9597 * @param console
9698 * @param settingsStore
9799 * either workspace or project settings
@@ -163,7 +165,9 @@ public CppcheckCommand(IConsole console, String binaryPath,
163165 }
164166
165167 if (projectFile .isEmpty () || !projectFile .endsWith (CPPCHECK_PROJ_STRING )) {
166- addPremiumChecks (settingsStore );
168+ if (settingsStore .getBoolean (IPreferenceConstants .P_PREMIUM )) {
169+ addPremiumChecks (settingsStore );
170+ }
167171 }
168172
169173 if (settingsStore .getBoolean (IPreferenceConstants .P_CHECK_VERBOSE )) {
0 commit comments