varvet/godmin

View on GitHub
lib/godmin/helpers/filters.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method has too many lines. [29/25]
Open

      def filter_select(name, options, html_options)
        unless options[:collection].is_a? Proc
          raise "A collection proc must be specified for select filters"
        end

Severity: Minor
Found in lib/godmin/helpers/filters.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for filter_select is too high. [19.34/15]
Open

      def filter_select(name, options, html_options)
        unless options[:collection].is_a? Proc
          raise "A collection proc must be specified for select filters"
        end

Severity: Minor
Found in lib/godmin/helpers/filters.rb by rubocop

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

Method filter_select has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def filter_select(name, options, html_options)
        unless options[:collection].is_a? Proc
          raise "A collection proc must be specified for select filters"
        end

Severity: Minor
Found in lib/godmin/helpers/filters.rb - About 1 hr to fix

    Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
    Open

            unless options[:collection].is_a? Proc
    Severity: Minor
    Found in lib/godmin/helpers/filters.rb by rubocop

    Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

    Example:

    # bad
    if condition
      do_stuff(bar)
    end
    
    unless qux.empty?
      Foo.do_something
    end
    
    # good
    do_stuff(bar) if condition
    Foo.do_something unless qux.empty?

    There are no issues that match your filters.

    Category
    Status