Skip to content
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

Add support of Facebook Infer static analyzer #1868

Merged

Conversation

begarco
Copy link
Contributor

@begarco begarco commented May 17, 2020

Proposed changes

This pull request only adds support of the Infer static analyzer. It is able to import the JSON report containing warnings about potential source of bugs.

Supported version of Infer: 0.17.0

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update

Checklist

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove the feature works
  • I have added necessary documentation (if appropriate)

This change is Reviewable

@ghost
Copy link

ghost commented May 17, 2020

Congratulations 🎉. DeepCode analyzed your code in 0.240 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard

@guwirth guwirth added this to the 2.0.0 milestone May 18, 2020
@guwirth
Copy link
Collaborator

guwirth commented May 18, 2020

Hello @begarcom,

Thx for providing this. I will review it ASAP.

Regards,

Copy link
Collaborator

@guwirth guwirth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@begarco thanks a lot looks good, well done. I have only one small hint.

@guwirth
Copy link
Collaborator

guwirth commented May 20, 2020

@begarco to document this feature it would be helpful:

  • link to infer tool?
  • with which version of the tool did you the tests?
  • how to call / use the tool to generate the report?
  • link to report file format?

@begarco
Copy link
Contributor Author

begarco commented May 21, 2020

@guwirth I push change asap

For other questions:

  • Infer official web site: https://fbinfer.com/
  • Supported version: 0.17.0 (the latest)
  • Usage: infer run --report-force-relative-path --linters --keep-going -- make (you can replace make by your own build command)
  • Report file format: JSON as defined here

Copy link
Collaborator

@guwirth guwirth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@begarco sorry to bother you again. Have one comment, rest looks good.

String.valueOf(issue.getLine()), issue.getQualifier());
sensor.saveUniqueViolation(cxxReportIssue);
} else {
LOG.debug("Cannot find the file '{}', skipping violations", issue.getFile());
Copy link
Collaborator

@guwirth guwirth May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@begarco think this message is wrong? It’s more Invalid infer issue/message... file as parameter makes also no sense, is null. Would add issue.toString.

@guwirth guwirth merged commit 3e518a8 into SonarOpenCommunity:master May 22, 2020
@guwirth
Copy link
Collaborator

guwirth commented May 22, 2020

@begarco thanks a lot for providing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants