engines/scc/extractor.rb in codemonitor-0.3.6 vs engines/scc/extractor.rb in codemonitor-0.4.0

- old
+ new

@@ -9,12 +9,10 @@ FIELDS = %w[Bytes Lines Code Comment Blank Complexity Count WeightedComplexity] def initialize; end def call(provider) - return unless requirements? - metrics = METRICS.map do |metric| [metric, send(metric)] end.to_h metrics @@ -22,16 +20,15 @@ .merge!(scc_by_file_type) provider.emit(metrics) end - private - def requirements? File.exist?('scc.output.json') end - # NOTE: This output file must be created by an external command + private + def scc @scc ||= JSON.parse(File.read('scc.output.json')) end def scc_totals