@@ -215,6 +215,23 @@ class ToolPredicate: public IPredicate {
215215 }
216216};
217217
218+ class ImpLevelFilter : public AbstractFilter {
219+ private:
220+ const int minLevel_;
221+
222+ public:
223+ ImpLevelFilter (AbstractWriter *agent, const int minLevel):
224+ AbstractFilter (agent),
225+ minLevel_ (minLevel)
226+ {
227+ }
228+
229+ protected:
230+ bool matchDef (const Defect &def) override {
231+ return minLevel_ <= def.imp ;
232+ }
233+ };
234+
218235class KeyEventPredicate : public IPredicate {
219236 private:
220237 const RE re_;
@@ -526,7 +543,7 @@ bool chainFilters(
526543 return false ;
527544 }
528545
529- return true ;
546+ return chainDecoratorIntArg<ImpLevelFilter>(pEng, vm, " imp-level " ) ;
530547}
531548
532549int main (int argc, char *argv[])
@@ -552,6 +569,7 @@ int main(int argc, char *argv[])
552569 (" tool" , po::value<string>(), " defect matches if it was detected by tool that matches the given regex" )
553570 (" annot" , po::value<string>(), " defect matches if its annotation matches the given regex" )
554571 (" src-annot" , po::value<string>(), " defect matches if an annotation in the _source_ file matches the given regex" )
572+ (" imp-level" , po::value<int >(), " defect matches if the importance level is greater or equal than the given number" )
555573
556574 (" drop-scan-props" , " do not propagate scan properties" )
557575 (" embed-context,U" , po::value<int >(), " embed a number of lines of context from the source file for the key event" )
0 commit comments