lib/attractor/calculators/js_calculator.rb in attractor-1.0.2 vs lib/attractor/calculators/js_calculator.rb in attractor-1.1.0
- old
+ new
@@ -2,9 +2,10 @@
module Attractor
class JsCalculator < BaseCalculator
def initialize(file_prefix: '', minimum_churn_count: 3)
super(file_prefix: file_prefix, file_extension: '(js|jsx)', minimum_churn_count: minimum_churn_count)
+ @type = "JavaScript"
end
def calculate
super do |change|
complexity, details = JSON.parse(`node #{__dir__}/../../../dist/calculator.bundle.js #{Dir.pwd}/#{change[:file_path]}`)