@@ -215,6 +215,23 @@ class ToolPredicate: public IPredicate {
215
215
}
216
216
};
217
217
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
+
218
235
class KeyEventPredicate : public IPredicate {
219
236
private:
220
237
const RE re_;
@@ -526,7 +543,7 @@ bool chainFilters(
526
543
return false ;
527
544
}
528
545
529
- return true ;
546
+ return chainDecoratorIntArg<ImpLevelFilter>(pEng, vm, " imp-level " ) ;
530
547
}
531
548
532
549
int main (int argc, char *argv[])
@@ -552,6 +569,7 @@ int main(int argc, char *argv[])
552
569
(" tool" , po::value<string>(), " defect matches if it was detected by tool that matches the given regex" )
553
570
(" annot" , po::value<string>(), " defect matches if its annotation matches the given regex" )
554
571
(" 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" )
555
573
556
574
(" drop-scan-props" , " do not propagate scan properties" )
557
575
(" embed-context,U" , po::value<int >(), " embed a number of lines of context from the source file for the key event" )
0 commit comments