lib/ring/sqa/analyzer.rb in ring-sqa-0.2.2 vs lib/ring/sqa/analyzer.rb in ring-sqa-0.3.0
- old
+ new
@@ -66,11 +66,12 @@
def median
last = @median_of-1
node_count[0..last].sort[last/2]
end
def exceed_median? tolerance=CFG.analyzer.tolerance
- violate = (median+1)*tolerance
- node_count[@median_of..-1].all? { |e| e > violate }
+ violate_relative = (median+1)*tolerance.relative
+ violate_absolute = (median+1)+tolerance.absolute
+ node_count[@median_of..-1].all? { |e| e > violate_relative && e > violate_absolute }
end
def node_count
@array.map { |nodes| nodes.size }
end
def exceeding_nodes