Skip to content

Add logical locations to SARIF reports - #1456

Merged
mmvpm merged 3 commits into
mainfrom
ideaseeker/sarif_logical_locations
Dec 7, 2022
Merged

Add logical locations to SARIF reports#1456
mmvpm merged 3 commits into
mainfrom
ideaseeker/sarif_logical_locations

Conversation

@mmvpm

@mmvpmmmvpm commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

Description

A new field has been introduced in SARIF reports: locations.logialLocations. It is used to store the class name in which an error was detected.

Example:

"locations" : [ {
"physicalLocation" : {
"artifactLocation" : {
"uri" : "src/main/java/io/github/ideaseeker/Main.java",
"uriBaseId" : "%SRCROOT%"
},
"region" : {
"startLine" : 6,
"startColumn" : 9
}
}
}, {
"logicalLocations" : [ { // new field"fullyQualifiedName" : "io.github.ideaseeker.Main"
} ]
} ],

It helps to fix#1381 because errors from the one class may refer to another class.

Also this PR fixes#1383 by adding org.utbot.sarif.SarifReport#getMethodDefinitionLineNumber for methods without the last line number in the execution path:

image

Fixes#1381, #1383

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Regression and integration tests

org.utbot.sarif.SarifReportTest

Manual Scenario

Please, repeat the scenario from the issues and check the result

Checklist:

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@mmvpm
mmvpmforce-pushed the ideaseeker/sarif_logical_locations branch from a582daa to 5728fb4CompareDecember 7, 2022 07:30
@mmvpmmmvpm self-assigned this Dec 7, 2022
@mmvpm
mmvpm merged commit bfe7ed0 into mainDec 7, 2022
@mmvpm
mmvpm deleted the ideaseeker/sarif_logical_locations branch December 7, 2022 08:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect line is addressed from Problems tool window for the sandboxed Socket.connect Incorrect Problems visualizing for InnerCalls.doubleCallFactorial

2 participants

@mmvpm@SBOne-Kenobi