This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer][Docs][NFC] Add CodeChecker to the command line tools
ClosedPublic

Authored by martong on Nov 19 2019, 6:05 AM.

Details

Summary

We add a new common html file that documents the available command line tools.
Also a new html is added for a brief description of CodeChecker, this way complementing scan-build.

Diff Detail

Event Timeline

martong created this revision.Nov 19 2019, 6:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2019, 6:05 AM
Szelethus accepted this revision.Nov 21 2019, 2:12 AM

For reasons other than being a part of the project, CodeChecker is objectively an amazing tool to use with the analyzer. LGTM!

This revision is now accepted and ready to land.Nov 21 2019, 2:12 AM

@Szelethus, Kristof thanks for the review.
@NoQ Ping. I'd like to have an approve from somebody who is outside the CodeChecker/E/// gang.

NoQ added a comment.Dec 3 2019, 7:07 PM

Hey, thanks for waiting on me! I'm slow these days, just 50 more mails to go >.<

This review strikes me as a wiki material. I wonder what's the community stance on making wikis. #showerthoughs

clang/www/analyzer/codechecker.html
14

Note related to your patch, but SSI seem to be completely broken these days; previously the dropdown menus header kept working on the front page but now even that's missing. Patches are very welcome >.<

24

I think you should start with installing CodeChecker. I.e.,

  1. Clone it from github: git clone ....
  2. ???
29

I'm confused. I obtained an overview, but what are the steps that i need to do if i want to actually view the issues? I have to start the web server anyway, right? Then what's the point of of invoking check separately? Can you invoke check from the web server directly?

I wish this document looked more like a step-by-step guide on how to obtain the results (or how to set up a collaborative server). Right now it's a collection of seemingly unrelated solutions for sub-problems that I don't immediately understand how to combine in order to obtain the desired result.

clang/www/analyzer/command-line.html
19

The first thing that we want to underline here is that the user should ABSOLUTELY NOT try to read warnings from the command line. I still see a lot of users who try to read scan-build's standard output and understand warnings from there without seeing any path notes.

I suggest the following intro:

"Static Analyzer is by design a GUI tool. Its purpose is to find buggy execution paths in the program, and such paths are very hard to comprehend by looking at a non-interactive standard output. It is possible, however, to invoke the Static Analyzer from the command line in order to obtain analysis results, and then later view them interactively in a graphical interface."

20

Do you plan to eventually mention clang-tidy as well?

23–28

WDYT of the following:

Scan-Build is an old and simple command-line tool that emits static analyzer warnings as HTML files while compiling your project. You can view analysis results in your web browser.

  • Useful for individual developers who simply want to view static analysis results at their desk, or in very simple collaborative environment.
  • Works on all major platforms (Windows, Linux, macOS) and is available as a package in many linux distributions.
  • Does not include support for cross-translation-unit analysis.
29

Let's describe the tool a bit as well. Maybe something like this:

CodeChecker is a web server that runs the Static Analyzer on your projects on demand and maintains a database of issues.

  • Perfect for managing large amounts of Static Analyzer warnings in a collaborative environment.
  • Generally much more feature-rich than scan-build.
  • (more stuff here)
32

LLVM is now also hosted on github, so not sure what the message is. We should probably either provide a link or just say that it's out-of-tree.

33–34

The same is true for scan-build.

Also, while it is possible that one of the tools does a strictly better job than the other, but the problem is, i think, generally unsolvable, because there's no perfect correspondence between GCC flags and Clang flags. So i think we should avoid strong statements here ("work seamlessly") - even intercepting the build system (let alone setting correct compiler flags) is an unsolvable problem in general.

martong updated this revision to Diff 232371.Dec 5 2019, 9:41 AM
martong marked 15 inline comments as done.

Addressing Artem's review comments.
Artem, thanks for the review!

clang/www/analyzer/codechecker.html
14

Ok, actually, this line is a result of copy pasting from scan-build.html. I don't think I'd be competence enough to solve the drop-down menu issue, so, I just removed this line.

29

Ok, I've rewritten this to be more like a step-by-step howto and to be as simple as possible.

clang/www/analyzer/command-line.html
19

Okay, I added it at the beginning of the first paragraph.

20

Ok, I added that since CodeChecker can handle clang-tidy checkers too.

23–28

Sounds good to me, updated like that.

29

Ok.

32

Ok, I removed the "github" part.

33–34

Alright, I removed this list item.

NoQ added inline comments.Dec 5 2019, 5:59 PM
clang/www/analyzer/codechecker.html
14

No-no, i'd rather keep it. Otherwise how do we remember to fix it? :D

49

Maybe xdg-open?

I would change the order of CCh and scan-build because we usually list stuff in alphabetical order. Also the chronological order is that, the newest is the first.

clang/www/analyzer/command-line.html
55

LLVM peoples seems to care to use open source projects, so I would mention it.

martong marked 6 inline comments as done.EditedDec 6 2019, 6:02 AM

I would change the order of CCh and scan-build because we usually list stuff in alphabetical order. Also the chronological order is that, the newest is the first.

I am not sure if the order matters that much because the page is very terse and small, so a reader can have a quick look to see that there are only these tools.

clang/www/analyzer/codechecker.html
14

Alright, I've put it back.

49

I'd like to keep "firefox" so readers immediately know that we are dealing with a web-browser. "xdg-open" might not be that obvious I think.

clang/www/analyzer/command-line.html
55

Ok, I added that to this list item.

martong updated this revision to Diff 232540.Dec 6 2019, 6:02 AM
martong marked 3 inline comments as done.

Put back the menu, add "open source" property.

NoQ accepted this revision.Dec 10 2019, 4:10 PM

Thanks!!~

This revision was automatically updated to reflect the committed changes.