File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -128,18 +128,25 @@ bool CweMap::assignCwe(Defect &def) const {
128128 }
129129
130130 // lookup by event
131+ int &cweDst = def.cwe ;
131132 const Private::TNumByEvent &row = rowIt->second ;
132133 const DefEvent &evt = def.events [def.keyEventIdx ];
133134 Private::TNumByEvent::const_iterator cweIt = row.find (evt.event );
134135 if (row.end () == cweIt) {
135136 if (!d->silent )
136137 std::cerr << " warning: CWE not found: checker = " << def.checker
137138 << " , event = " << evt.event << " \n " ;
139+
140+ if (def.checker == " CPPCHECK_WARNING" ) {
141+ // we cannot fallback to a random CWE that Cppcheck has mapping for
142+ cweDst = 0 ;
143+ return false ;
144+ }
145+
138146 cweIt = row.begin ();
139147 }
140148
141149 const int cweSrc = cweIt->second ;
142- int &cweDst = def.cwe ;
143150 if (cweSrc == cweDst)
144151 // already assigned
145152 return true ;
You can’t perform that action at this time.
0 commit comments