Sha256: 9fd0396c95a69a0207ae680b889e30161374e5ba86c950a7b6baae626217fa6b

Contents?: true

Size: 1.17 KB

Versions: 9

Compression:

Stored size: 1.17 KB

Contents

module MetricFu
  module CaneViolations
    class AbcComplexity
      def self.parse(violation_list)
        violation_list.split(/\n/).map do |violation|
          file, method, complexity = violation.split
          { file: file, method: method, complexity: complexity }
        end
      end
    end

    class LineStyle
      def self.parse(violation_list)
        violation_list.split(/\n/).map do |violation|
          line, description = violation.split(/\s{2,}/).reject { |x|x.strip == "" }
          { line: line, description: description }
        end
      end
    end

    class Comment
      def self.parse(violation_list)
        violation_list.split(/\n/).map do |violation|
          line, class_name = violation.split
          { line: line, class_name: class_name }
        end
      end
    end

    class Documentation
      def self.parse(violation_list)
        violation_list.split(/\n/).map do |violation|
          { description: violation.strip }
        end
      end
    end

    class Others
      def self.parse(violation_list)
        violation_list.split(/\n/).map do |violation|
          { description: violation.strip }
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
metric_fu-4.13.0 lib/metric_fu/metrics/cane/violations.rb
fastruby-metric_fu-5.0.0 lib/metric_fu/metrics/cane/violations.rb
code_metric_fu-4.14.4 lib/metric_fu/metrics/cane/violations.rb
code_metric_fu-4.14.3 lib/metric_fu/metrics/cane/violations.rb
code_metric_fu-4.14.2 lib/metric_fu/metrics/cane/violations.rb
code_metric_fu-4.14.1 lib/metric_fu/metrics/cane/violations.rb
code_metric_fu-4.14.0 lib/metric_fu/metrics/cane/violations.rb
metric_fu-4.12.0 lib/metric_fu/metrics/cane/violations.rb
metric_fu-4.11.4 lib/metric_fu/metrics/cane/violations.rb