File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323#include " cppcheckexecutor.h"
2424
2525#include " analyzerinfo.h"
26- #include " check.h"
2726#include " checkersreport.h"
28- #include " checkunusedfunctions.h"
2927#include " cmdlinelogger.h"
3028#include " cmdlineparser.h"
3129#include " color.h"
3533#include " errortypes.h"
3634#include " filesettings.h"
3735#include " json.h"
38- #include " preprocessor.h"
3936#include " settings.h"
4037#include " singleexecutor.h"
4138#include " suppressions.h"
42- #include " tokenize.h"
4339#include " utils.h"
4440
4541#if defined(HAS_THREADING_MODEL_THREAD)
5955#include < iostream>
6056#include < list>
6157#include < map>
62- #include < regex>
6358#include < set>
6459#include < sstream>
6560#include < unordered_set>
Original file line number Diff line number Diff line change 3939#include < string>
4040#include < unordered_map>
4141#include < utility>
42- #include < regex>
4342
4443#include " xml.h"
4544
@@ -213,7 +212,6 @@ ErrorMessage::ErrorMessage(const tinyxml2::XMLElement * const errmsg)
213212 }
214213}
215214
216- // Convert instance-specific messages to generic ones
217215void ErrorMessage::setmsg (const std::string &msg)
218216{
219217 // If a message ends to a '\n' and contains only a one '\n'
@@ -495,9 +493,6 @@ std::string ErrorMessage::toXML() const
495493 printer.PushAttribute (" classification" , classification.c_str ());
496494 printer.PushAttribute (" msg" , fixInvalidChars (mShortMessage ).c_str ());
497495 printer.PushAttribute (" verbose" , fixInvalidChars (mVerboseMessage ).c_str ());
498- // TODO: Generic message was added for SARIF output format, consider whether to include in XML
499- // if (!mGenericMessage.empty())
500- // printer.PushAttribute("generic", fixInvalidChars(mGenericMessage).c_str());
501496 if (cwe.id )
502497 printer.PushAttribute (" cwe" , cwe.id );
503498 if (hash)
Original file line number Diff line number Diff line change @@ -377,11 +377,8 @@ def test_sarif():
377377 assert 'security' in res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['properties' ]['tags' ]
378378 assert re .match (r'[0-9]+(.[0-9]+)+' , res ['runs' ][0 ]['tool' ]['driver' ]['semanticVersion' ])
379379 assert 'level' in res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['defaultConfiguration' ] # #13885
380- # Test that rule description is now the generic mapped description, not instance-specific
381- assert res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['shortDescription' ]['text' ] == 'Division by zero'
382- # Test that the result message is still the instance-specific message
380+ assert res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['shortDescription' ]['text' ] == ''
383381 assert res ['runs' ][0 ]['results' ][0 ]['message' ]['text' ] == 'Division by zero.'
384- # Test that problem.severity property exists and is correct
385382 assert res ['runs' ][0 ]['tool' ]['driver' ]['rules' ][0 ]['properties' ]['problem.severity' ] == 'error'
386383
387384
You can’t perform that action at this time.
0 commit comments