Skip to content

Commit

Permalink
exclude findbugs violations when line information is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
peterg79 committed Dec 8, 2017
1 parent d16b683 commit 00237b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions diff_cover/violationsreporters/java_violations_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def parse_reports(self, reports):
category = bug.get('category')
short_message = bug.find('ShortMessage').text
line = bug.find('SourceLine')
if line.get('start') is None or line.get('end') is None:
continue
start = int(line.get('start'))
end = int(line.get('end'))
for line_number in range(start, end+1):
Expand Down

0 comments on commit 00237b3

Please sign in to comment.