Skip to content

reported infer issues not shown as accepted issues #2818

@mrwsl

Description

@mrwsl

Describe the bug
Foremost, thank you for this wonderful plugin!

I am scanning code with infer and it reports findings:

src/somefile.h:311: error: Dead Store
  The value written to `&matrixXf2String` is never used. 
  309.   std::string       out   = "\n" + stars + " GCode::Data::Part to_string " + stars;
  310. 
  311.   auto matrixXf2String = []( const eg::MatrixXf& mat ) -> std::string {
         ^
  312.     assert( "Matrix is not 3 x p as expected" && ( mat.rows() == 3 ) );
  313. 
tests/somefile2.cpp:217: error: Null Dereference
  `...` could be null (from the call to `...::append_layer()` on line 206) and is dereferenced in the call to `...`. 
  215.   } );
  216. 
  217.   EXPECT_EQ( ( testPath[ 0, 0, 0 ] ), eg::Vector3f( 0.0F, 0.0F, 0.0F ) ) << Message( "Read Path[0,0,0]" );
         ^
  218.   EXPECT_EQ( ( testPath[ 0, 0, 1 ] ), eg::Vector3f( 0.01F, 0.01F, 0.01F ) ) << Message( "Read Path[0,0,1]" );
  219. 
tests/somefile2.cpp:364: error: Null Dereference
  `...` could be null (from the call to `...` on line 353) and is dereferenced in the call to `...`. 
  362.   } );
  363. 
  364.   EXPECT_EQ( ( testPath[ 0, 0, 0 ] ), eg::Vector3f( 0.0F, 0.0F, 0.0F ) ) << Message( "Read Path[0,0,0]" );
         ^
  365.   EXPECT_EQ( ( testPath[ 0, 0, 1 ] ), eg::Vector3f( 0.01F, 0.01F, 0.01F ) ) << Message( "Read Path[0,0,1]" );
  366. 

In a next step, SonarScanner is reporting the found issues:

2024-11-20T15:07:07.5356247Z 15:07:07.535 INFO  Sensor CXX Infer report import [cxx]
2024-11-20T15:07:07.5358164Z 15:07:07.535 INFO  Processing report '/workspace/.../infer-out/report.json'
2024-11-20T15:07:07.5643016Z 15:07:07.563 INFO  Processing successful, saved new issues=3
2024-11-20T15:07:07.5643383Z 15:07:07.564 INFO  Sensor CXX Infer report import [cxx] (done) | time=29ms

In the project's overview of the analysis, the issues are not shown. I have set up a quality profile that has these two issues, “NULL_DEREFERENCE” and “DEAD_STORE” enabled.

To Reproduce
Steps to reproduce the behavior:

  1. Scan code with infer
  2. SonarScanner uploads issues

Expected behavior
New issues for the found problems are created

Desktop (please complete the following information):

  • OS: Linux
  • SonarQube version: 10.6
  • cxx plugin version: 2.2.0.760
  • sonar-scanner version: 6.0.0.4432

Additional context
This might not be a bug, but me not configuring SonarQube correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions