MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / applyEnabled

Method applyEnabled

lib/settings.cpp:292–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292std::string Settings::applyEnabled(const std::string &str, bool enable)
293{
294 std::tuple<SimpleEnableGroup<Severity>, SimpleEnableGroup<Checks>> groups;
295 std::string errmsg = parseEnabled(str, groups);
296 if (!errmsg.empty())
297 return (enable ? "--enable" : "--disable") + errmsg;
298
299 const auto s = std::get<0>(groups);
300 const auto c = std::get<1>(groups);
301 if (enable) {
302 severity.enable(s);
303 checks.enable(c);
304 }
305 else {
306 severity.disable(s);
307 checks.disable(c);
308 }
309 // FIXME: hack to make sure "error" is always enabled
310 severity.enable(Severity::error);
311 return {};
312}
313
314bool Settings::isEnabled(const ValueFlow::Value *value, bool inconclusiveCheck) const
315{

Callers

nothing calls this directly

Calls 3

enableMethod · 0.80
disableMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected