Class: MetzScan::Analyzers::RepeatedBranching::Finding

Inherits:
Struct
  • Object
show all
Defined in:
lib/metz_scan/analyzers/repeated_branching.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#branch_valuesObject

Returns the value of attribute branch_values

Returns:

  • (Object)

    the current value of branch_values



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def branch_values
  @branch_values
end

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def confidence
  @confidence
end

#decisionObject

Returns the value of attribute decision

Returns:

  • (Object)

    the current value of decision



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def decision
  @decision
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def kind
  @kind
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def message
  @message
end

#occurrencesObject

Returns the value of attribute occurrences

Returns:

  • (Object)

    the current value of occurrences



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def occurrences
  @occurrences
end

#project_analyzer_metadataObject

Returns the value of attribute project_analyzer_metadata

Returns:

  • (Object)

    the current value of project_analyzer_metadata



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def 
  @project_analyzer_metadata
end

#project_analyzer_statusObject

Returns the value of attribute project_analyzer_status

Returns:

  • (Object)

    the current value of project_analyzer_status



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def project_analyzer_status
  @project_analyzer_status
end

#rule_idObject

Returns the value of attribute rule_id

Returns:

  • (Object)

    the current value of rule_id



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def rule_id
  @rule_id
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def source
  @source
end

#suggested_next_movesObject

Returns the value of attribute suggested_next_moves

Returns:

  • (Object)

    the current value of suggested_next_moves



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def suggested_next_moves
  @suggested_next_moves
end

#triage_severityObject

Returns the value of attribute triage_severity

Returns:

  • (Object)

    the current value of triage_severity



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def triage_severity
  @triage_severity
end

#triage_summaryObject

Returns the value of attribute triage_summary

Returns:

  • (Object)

    the current value of triage_summary



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def triage_summary
  @triage_summary
end

#why_it_mattersObject

Returns the value of attribute why_it_matters

Returns:

  • (Object)

    the current value of why_it_matters



28
29
30
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 28

def why_it_matters
  @why_it_matters
end

Instance Method Details

#context_name(occurrence) ⇒ Object



36
37
38
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 36

def context_name(occurrence)
  [occurrence.enclosing_name, occurrence.method_name].compact.join.then { |name| name unless name.empty? }
end

#report_occurrencesObject



32
33
34
# File 'lib/metz_scan/analyzers/repeated_branching.rb', line 32

def report_occurrences
  occurrences.map { |occurrence| Occurrence.from(occurrence, context: context_name(occurrence)) }
end