codeclimate/codeclimate-duplication

Duplication Engine Line Counting Error

davehenton opened this issue · 2 comments

Description

A customer's analysis is raising a duplication issue for two LOC which each contain only "end".
This issue could potentially be related to #155

Reason (why are we doing this)

From @maxjacobson "Digging into it a little, it looks like the problem is that when the node that contains duplication is of type resbody, which is to say "the body of a rescue clause", our ruby parser doesn't correctly identify its line numbers. Looking into the ruby_parser code, there's a test for this, but it's marked as "skip" because it hasn't been fixed yet: https://github.com/seattlerb/ruby_parser/blob/eeef7355a39efa4cd9c60898e98d97b71906c416/test/test_ruby_parser.rb#L805"

Please please please ping me when you have problems with ruby_parser. I am much more liable to fix something specific if I'm nudged. I just fixed this one. Took me 10 minutes.

This should probably be closed.