sapristi-tool/sapristi

View on GitHub
lib/sapristi/attribute_normalizer.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for validate_percentage_field is too high. [16.31/15]
Open

    def validate_percentage_field
      min_percentage = { 'Height' => 0.05, 'Width' => 0.05 }.fetch(key, 0)
      unless Definition::TRANSLATIONS.include? key
        raise "#{key}=#{raw}, using percentage in invalid field, valid=#{Definition::TRANSLATIONS.keys.join(', ')}"
      end

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Line is too long. [120/80]
Open

      raise Error, "#{key} percentage is invalid=#{raw}, valid=5%-100%" if percentage < min_percentage || percentage > 1

Line is too long. [115/80]
Open

        raise "#{key}=#{raw}, using percentage in invalid field, valid=#{Definition::TRANSLATIONS.keys.join(', ')}"

There are no issues that match your filters.

Category
Status