Sha256: 43d7f5a2ea87e8e26c895bdbc40710097741fc4eb2da5042d14a4e69f9a5fecb

Contents?: true

Size: 683 Bytes

Versions: 9

Compression:

Stored size: 683 Bytes

Contents

MetricFu.reporting_require { "graphs/grapher" }
module MetricFu
  class CaneGrapher < Grapher
    attr_accessor :cane_violations, :labels

    def self.metric
      :cane
    end

    def initialize
      super
      @cane_violations = []
      @labels = {}
    end

    def get_metrics(metrics, date)
      if metrics && metrics[:cane]
        @cane_violations.push(metrics[:cane][:total_violations].to_i)
        @labels.update(@labels.size => date)
      end
    end

    def title
      "Cane: code quality threshold violations"
    end

    def data
      [
        ["cane", @cane_violations.join(",")]
      ]
    end

    def output_filename
      "cane.js"
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
metric_fu-4.13.0 lib/metric_fu/metrics/cane/grapher.rb
fastruby-metric_fu-5.0.0 lib/metric_fu/metrics/cane/grapher.rb
code_metric_fu-4.14.4 lib/metric_fu/metrics/cane/grapher.rb
code_metric_fu-4.14.3 lib/metric_fu/metrics/cane/grapher.rb
code_metric_fu-4.14.2 lib/metric_fu/metrics/cane/grapher.rb
code_metric_fu-4.14.1 lib/metric_fu/metrics/cane/grapher.rb
code_metric_fu-4.14.0 lib/metric_fu/metrics/cane/grapher.rb
metric_fu-4.12.0 lib/metric_fu/metrics/cane/grapher.rb
metric_fu-4.11.4 lib/metric_fu/metrics/cane/grapher.rb