Class: Moult::Report::Hotspot
- Inherits:
-
Object
- Object
- Moult::Report::Hotspot
- Defined in:
- lib/moult/report.rb
Overview
One ranked file.
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#churn ⇒ Object
readonly
Returns the value of attribute churn.
-
#complexity ⇒ Object
readonly
Returns the value of attribute complexity.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(path:, score:, complexity:, churn:, methods:, confidence: nil, category: nil) ⇒ Hotspot
constructor
A new instance of Hotspot.
- #to_h ⇒ Object
-
#worst_method ⇒ Object
The single worst method in the file, for table drill-down.
Constructor Details
#initialize(path:, score:, complexity:, churn:, methods:, confidence: nil, category: nil) ⇒ Hotspot
Returns a new instance of Hotspot.
57 58 59 60 61 62 63 64 65 |
# File 'lib/moult/report.rb', line 57 def initialize(path:, score:, complexity:, churn:, methods:, confidence: nil, category: nil) @path = path @score = score @complexity = complexity @churn = churn @methods = methods @confidence = confidence @category = category end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def category @category end |
#churn ⇒ Object (readonly)
Returns the value of attribute churn.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def churn @churn end |
#complexity ⇒ Object (readonly)
Returns the value of attribute complexity.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def complexity @complexity end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def confidence @confidence end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def methods @methods end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def path @path end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
50 51 52 |
# File 'lib/moult/report.rb', line 50 def score @score end |
Instance Method Details
#to_h ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/moult/report.rb', line 72 def to_h { path: path, score: score, complexity: complexity, churn: churn, confidence: confidence, category: category, methods: methods.map(&:to_h) } end |
#worst_method ⇒ Object
The single worst method in the file, for table drill-down.
68 69 70 |
# File 'lib/moult/report.rb', line 68 def worst_method methods.first end |