Class: MetricFu::CaneGenerator
- Defined in:
- lib/metric_fu/metrics/cane/generator.rb
Instance Attribute Summary collapse
-
#total_violations ⇒ Object
readonly
Returns the value of attribute total_violations.
-
#violations ⇒ Object
readonly
Returns the value of attribute violations.
Attributes inherited from Generator
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Generator
#generate_result, generators, get_generator, #initialize, #metric, #metric_config, metric_directory, #metric_directory, not_implemented, #remove_excluded_files, #round_to_tenths, #run!, #silence_streams
Constructor Details
This class inherits a constructor from MetricFu::Generator
Instance Attribute Details
#total_violations ⇒ Object (readonly)
Returns the value of attribute total_violations.
4 5 6 |
# File 'lib/metric_fu/metrics/cane/generator.rb', line 4 def total_violations @total_violations end |
#violations ⇒ Object (readonly)
Returns the value of attribute violations.
4 5 6 |
# File 'lib/metric_fu/metrics/cane/generator.rb', line 4 def violations @violations end |
Class Method Details
.metric ⇒ Object
6 7 8 |
# File 'lib/metric_fu/metrics/cane/generator.rb', line 6 def self.metric :cane end |
Instance Method Details
#analyze ⇒ Object
20 21 22 23 |
# File 'lib/metric_fu/metrics/cane/generator.rb', line 20 def analyze @violations = violations_by_category extract_total_violations end |
#emit ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/metric_fu/metrics/cane/generator.rb', line 10 def emit args = [ abc_max_param, style_measure_param, no_doc_param, no_readme_param ].join @output = run!(args) end |
#to_h ⇒ Object
25 26 27 |
# File 'lib/metric_fu/metrics/cane/generator.rb', line 25 def to_h { cane: { total_violations: @total_violations, violations: @violations, total: @total } } end |