Class: Bugwatch::ComplexityScore
- Inherits:
-
Object
- Object
- Bugwatch::ComplexityScore
- Defined in:
- lib/bugwatch/complexity_score.rb
Constant Summary collapse
- DEFAULT_COMPLEXITY =
0.0
Instance Attribute Summary collapse
-
#after_score ⇒ Object
readonly
Returns the value of attribute after_score.
-
#before_score ⇒ Object
readonly
Returns the value of attribute before_score.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #accumulated ⇒ Object
-
#initialize(file, before_score, after_score) ⇒ ComplexityScore
constructor
A new instance of ComplexityScore.
Constructor Details
#initialize(file, before_score, after_score) ⇒ ComplexityScore
Returns a new instance of ComplexityScore.
39 40 41 42 43 |
# File 'lib/bugwatch/complexity_score.rb', line 39 def initialize(file, before_score, after_score) @file = file @before_score = before_score @after_score = after_score end |
Instance Attribute Details
#after_score ⇒ Object (readonly)
Returns the value of attribute after_score.
37 38 39 |
# File 'lib/bugwatch/complexity_score.rb', line 37 def after_score @after_score end |
#before_score ⇒ Object (readonly)
Returns the value of attribute before_score.
37 38 39 |
# File 'lib/bugwatch/complexity_score.rb', line 37 def before_score @before_score end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
37 38 39 |
# File 'lib/bugwatch/complexity_score.rb', line 37 def file @file end |
Instance Method Details
#accumulated ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/bugwatch/complexity_score.rb', line 45 def accumulated if before_score && after_score after_score - before_score elsif after_score after_score elsif before_score -before_score else DEFAULT_COMPLEXITY end end |