How to analyze header files?

69 views
Skip to first unread message

Christian Taedcke

unread,
Jan 24, 2014, 2:43:33 PM1/24/14
to oclin...@googlegroups.com
Hi Longyi, hi group,

i created a branch with your suggestions from another thread: https://github.com/chrta/oclint/tree/analyze_header_files. This works only for AST rules, but not for rules based on
AbstractSourceCodeReaderRule.

In the code above i only exclude system headers, but not external library headers etc. But i think this is better than the current situation where no header is analyzed. What do you think?

To prevent duplicated violations i adapted the PMD reporter to remove them, see https://github.com/chrta/oclint/tree/remove_duplicate_violations. Is this the proper way? I would like to include something like this in every reporter (without duplicating code).

What would be the proper way to analyze also rules based on
AbstractSourceCodeReaderRule? I think it would be best to collect all included files in a set (to prevent duplicates) and then analyze them as the source files.

Regards,
Christian

Longyi Qi

unread,
Jan 26, 2014, 5:11:45 PM1/26/14
to Christian Taedcke, oclin...@googlegroups.com
Thank you Christian.

I like both ideas. I would suggest work on getting rid of the duplications prior to analyzing headers, as you have noticed, if duplications exist, headers will eventually contribute massive of duplications.

I think you are on the right track. I would hope `oclint-core` contains the entire set of raw violations, meaning duplications are allowed in `Results`. We might need to refer back to the original violation set. 

So you could extract `UniqueResults` from `PMDReporter`, and use it in other reporters.

I was also wondering if we should introduce a command line flag with something like `-allow-duplicated-violations`, and when it’s enabled, we will output violations from `Results` instead of `UniqueResutls`.

Thanks,
Longyi
--
You received this message because you are subscribed to the Google Groups "OCLint Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oclint-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages