Class: MetricFu::MetricCane

Inherits:
Metric
  • Object
show all
Defined in:
lib/metric_fu/metrics/cane/metric.rb

Instance Attribute Summary

Attributes inherited from Metric

#activated, #enabled

Instance Method Summary collapse

Methods inherited from Metric

#configured_run_options, #default_run_args, enabled_metrics, #gem_name, get_metric, #initialize, metrics, #run, #run_external, #run_options

Constructor Details

This class inherits a constructor from MetricFu::Metric

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MetricFu::Metric

Instance Method Details

#activateObject



30
31
32
# File 'lib/metric_fu/metrics/cane/metric.rb', line 30

def activate
  super
end

#default_run_optionsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/metric_fu/metrics/cane/metric.rb', line 7

def default_run_options
  {
    dirs_to_cane: MetricFu::Io::FileSystem.directory("code_dirs"),
    abc_max: 15,
    line_length: 80,
    no_doc: "n",
    no_readme: "n",
    filetypes: ["rb"]
  }
end

#enableObject



22
23
24
25
26
27
28
# File 'lib/metric_fu/metrics/cane/metric.rb', line 22

def enable
  if MetricFu.configuration.supports_ripper? && !MetricFu.configuration.ruby18?
    super
  else
    MetricFu.logger.debug("Cane is only available in MRI. It requires ripper and 1.9 hash syntax support")
  end
end

#has_graph?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/metric_fu/metrics/cane/metric.rb', line 18

def has_graph?
  true
end

#nameObject



3
4
5
# File 'lib/metric_fu/metrics/cane/metric.rb', line 3

def name
  :cane
end