Skip to content

Add logical locations to SARIF reports #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

mmvpm
Copy link
Collaborator

@mmvpm mmvpm commented Dec 5, 2022

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 mmvpm force-pushed the ideaseeker/sarif_logical_locations branch from a582daa to 5728fb4 Compare December 7, 2022 07:30
@mmvpm mmvpm requested a review from SBOne-Kenobi December 7, 2022 08:19
@mmvpm mmvpm self-assigned this Dec 7, 2022
@mmvpm mmvpm merged commit bfe7ed0 into main Dec 7, 2022
@mmvpm mmvpm deleted the ideaseeker/sarif_logical_locations branch December 7, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants