class PmdViolation

Represent a PMD violation.

Constants

PRIORITY_ERROR_THRESHOLD

Attributes

violation[RW]

Public Class Methods

new(violation) click to toggle source
# File lib/pmd/entity/pmd_violation.rb, line 8
def initialize(violation)
  @violation = violation
end

Public Instance Methods

description() click to toggle source
# File lib/pmd/entity/pmd_violation.rb, line 24
def description
  @description ||= violation.text.gsub("\n", '')
end
line() click to toggle source
# File lib/pmd/entity/pmd_violation.rb, line 20
def line
  @line ||= violation.attribute('beginline').value.to_i
end
priority() click to toggle source
# File lib/pmd/entity/pmd_violation.rb, line 12
def priority
  @priority ||= violation.attribute('priority').value.to_i
end
type() click to toggle source
# File lib/pmd/entity/pmd_violation.rb, line 16
def type
  @type ||= priority < PRIORITY_ERROR_THRESHOLD ? :warn : :fail
end