Class: Review::ComplexityReport
- Inherits:
-
Object
- Object
- Review::ComplexityReport
- Defined in:
- lib/iosappaudit/Review/complexity_report.rb
Instance Attribute Summary collapse
-
#file_measure ⇒ Object
Returns the value of attribute file_measure.
-
#function_measure ⇒ Object
Returns the value of attribute function_measure.
Instance Method Summary collapse
- #file_metrics_sorted_by_ccn ⇒ Object
- #file_metrics_with_more_than_count_lines(count) ⇒ Object
-
#initialize(function_measure = [], file_measure = []) ⇒ ComplexityReport
constructor
A new instance of ComplexityReport.
Constructor Details
#initialize(function_measure = [], file_measure = []) ⇒ ComplexityReport
Returns a new instance of ComplexityReport.
57 58 59 60 |
# File 'lib/iosappaudit/Review/complexity_report.rb', line 57 def initialize(function_measure = [], file_measure = []) @function_measure = function_measure @file_measure = file_measure end |
Instance Attribute Details
#file_measure ⇒ Object
Returns the value of attribute file_measure.
55 56 57 |
# File 'lib/iosappaudit/Review/complexity_report.rb', line 55 def file_measure @file_measure end |
#function_measure ⇒ Object
Returns the value of attribute function_measure.
55 56 57 |
# File 'lib/iosappaudit/Review/complexity_report.rb', line 55 def function_measure @function_measure end |
Instance Method Details
#file_metrics_sorted_by_ccn ⇒ Object
66 67 68 |
# File 'lib/iosappaudit/Review/complexity_report.rb', line 66 def file_metrics_sorted_by_ccn file_measure.metrics.sort { |lhs, rhs| (lhs.ccn <=> rhs.ccn) * -1 } end |
#file_metrics_with_more_than_count_lines(count) ⇒ Object
62 63 64 |
# File 'lib/iosappaudit/Review/complexity_report.rb', line 62 def file_metrics_with_more_than_count_lines(count) file_measure.metrics.select { |metric| metric.ncss >= count }.sort { |lhs, rhs| (lhs.ncss <=> rhs.ncss) * -1 } end |