Closed Bug 1756032 Opened 2 years ago Closed 2 years ago

[Automated review] reviewbot's clang-tidy errors aren't actionable

Categories

(Developer Infrastructure :: Source Code Analysis, defect, P1)

Tracking

(firefox101-, firefox102-, firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox101 - ---
firefox102 - ---
firefox104 --- fixed

People

(Reporter: bytesized, Assigned: andi)

References

Details

Attachments

(2 files)

Attached file static_analysis_output

Phabricator URL: https://phabricator.services.mozilla.com/D138593

Reviewbot keeps complaining about my patch.

Code analysis found 3 defects in the diff 540553:

  • 3 build errors found by clang-tidy

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects on the code-review frontend and on Treeherder.

Running the analysis locally is very confusing. I attached the output to this bug report. I see a number of problems with it:

  1. It seems to be trying to use color codes. But they aren't working properly, which makes the whole thing really, really hard to read. This is not an uncommon problem on Windows. It is possible to make them work right (I use them in my BASH prompt). But it also seems to be really easy to screw them up. I think that Bug 1417003 has some more details about this.
  2. There appear to be 18 different summary lines ("X warnings and Y errors generated"). It's not clear which, if any of them, I should pay attention to.
  3. Despite the --outgoing flag, many (maybe all?) of the warnings and errors listed are not in outgoing code. Some of them appear to be in files (but not lines) that were touched in this patch. Others appear to be in files that this patch had nothing to do with (ex: Span.h).
  4. "Error while processing" appears in the output 19 times, but it's unclear to me what the error is.

Additionally, I feel like there are just a whole bunch of problems with reviewbot's comment:

  1. It doesn't seem to line up at all with what the local analysis says.
  2. Unlike other reviewbot comments I've gotten, it doesn't give me any idea what the errors are. It doesn't call them out individually. It doesn't link to a patch that fixes them. The only suggestion of what to do is to run the analysis locally, but it doesn't line up with that.
  3. The "the code-review frontend" link is also unhelpful. It does mention 3 errors. Which does seem to line up with the "3 build errors" that reviewbot mentions. But none of them are in code touched by this patch. It seems to acknowledge this with the red X by the "In Patch" line. But it seems to be mad about them anyways? I don't really understand why.
  4. The above points make the reviewbot comment completely non-actionable.

The severity field is not set for this bug.
:andi, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(bpostelnicu)

This is an issue in our static-analysis checker.

Severity: -- → S2
Flags: needinfo?(bpostelnicu)
Priority: -- → P2
Severity: S2 → S1
Priority: P2 → P1
Severity: S1 → S2
Priority: P1 → --
Priority: -- → P1
Assignee: nobody → bpostelnicu

By activating clang-plugin we make sure that all defines for static-analysis are
in place.

Attachment #9284339 - Attachment description: WIP: Bug 1756032 - for `clang-tidy` based analysis also activate `clang-plugin`. → Bug 1756032 - for `clang-tidy` based analysis also activate `clang-plugin`.
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e6e57de6883
for `clang-tidy` based analysis also activate `clang-plugin`. r=firefox-static-analysis-reviewers,marco
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: