Module: ChurnVsComplexity::Gate::Serializer::Json

Defined in:
lib/churn_vs_complexity/gate/serializer.rb

Class Method Summary collapse

Class Method Details

.serialize(result, max_gamma:) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/churn_vs_complexity/gate/serializer.rb', line 10

def serialize(result, max_gamma:)
  violations = find_violations(result[:values_by_file], max_gamma)

  JSON.generate(
    passed: violations.empty?,
    threshold: { max_gamma: },
    violations:,
  )
end