Class: Review::ComplexityReport

Inherits:
Object
  • Object
show all
Defined in:
lib/iosappaudit/Review/complexity_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_measureObject

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_measureObject

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_ccnObject



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