Module: Hoe::Flog

Defined in:
lib/hoe/flog.rb

Overview

Flog plugin for hoe.

Tasks Provided:

flog

Analyze code complexity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#flog_methodObject

Optional: flog method to run to determine threshold. [default: :max_method]



17
18
19
# File 'lib/hoe/flog.rb', line 17

def flog_method
  @flog_method
end

#flog_thresholdObject

Optional: flog threshold to determine threshold failure. [default: 1500-200]



12
13
14
# File 'lib/hoe/flog.rb', line 12

def flog_threshold
  @flog_threshold
end

Instance Method Details

#define_flog_tasksObject

Define tasks for plugin.



30
31
32
33
34
35
# File 'lib/hoe/flog.rb', line 30

def define_flog_tasks
  require "flog_task"
  FlogTask.new :flog, self.flog_threshold, nil, self.flog_method
rescue LoadError
  # skip
end

#initialize_flogObject

Initialize variables for plugin.



22
23
24
25
# File 'lib/hoe/flog.rb', line 22

def initialize_flog
  self.flog_method    ||= :max_method
  self.flog_threshold ||= 20 # 2x industry avg
end