Class: Moult::CyclesReport::Finding

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

Overview

One circular file-dependency group. cycle_group ("scc:") is the group's join key — membership-stable across runs and machines, unlike a detector-backend hash. edges are the in-cycle dependencies, each with a representative reference site.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#categoryObject

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def category
  @category
end

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def confidence
  @confidence
end

#cycle_groupObject

Returns the value of attribute cycle_group

Returns:

  • (Object)

    the current value of cycle_group



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def cycle_group
  @cycle_group
end

#edgesObject

Returns the value of attribute edges

Returns:

  • (Object)

    the current value of edges



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def edges
  @edges
end

#filesObject

Returns the value of attribute files

Returns:

  • (Object)

    the current value of files



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def files
  @files
end

#reasonsObject

Returns the value of attribute reasons

Returns:

  • (Object)

    the current value of reasons



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def reasons
  @reasons
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



16
17
18
# File 'lib/moult/cycles_report.rb', line 16

def size
  @size
end

Instance Method Details

#to_hObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/moult/cycles_report.rb', line 17

def to_h
  {
    cycle_group: cycle_group,
    category: category,
    confidence: confidence,
    size: size,
    files: files,
    reasons: reasons.map(&:to_h),
    edges: edges.map { |e| {src: e.src, dst: e.dst, constant: e.constant, span: e.span.to_h} }
  }
end