Class: Moult::DuplicationReport::Finding

Inherits:
Struct
  • Object
show all
Defined in:
lib/moult/duplication_report.rb

Overview

A confidence-graded clone group. Carries its reasons so no claim is made without a recorded justification. clone_group (":") is the group's join key, shared by every occurrence; stable within a report only (the hash comes from the detector backend).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clone_groupObject

Returns the value of attribute clone_group

Returns:

  • (Object)

    the current value of clone_group



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def clone_group
  @clone_group
end

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def confidence
  @confidence
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def kind
  @kind
end

#massObject

Returns the value of attribute mass

Returns:

  • (Object)

    the current value of mass



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def mass
  @mass
end

#node_typeObject

Returns the value of attribute node_type

Returns:

  • (Object)

    the current value of node_type



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def node_type
  @node_type
end

#occurrencesObject

Returns the value of attribute occurrences

Returns:

  • (Object)

    the current value of occurrences



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def occurrences
  @occurrences
end

#reasonsObject

Returns the value of attribute reasons

Returns:

  • (Object)

    the current value of reasons



27
28
29
# File 'lib/moult/duplication_report.rb', line 27

def reasons
  @reasons
end

Instance Method Details

#to_hObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/moult/duplication_report.rb', line 28

def to_h
  {
    category: Duplication::Confidence::CATEGORY,
    confidence: confidence,
    kind: kind.to_s,
    node_type: node_type,
    mass: mass,
    clone_group: clone_group,
    reasons: reasons.map(&:to_h),
    occurrences: occurrences.map(&:to_h)
  }
end