ManageIQ/manageiq

View on GitHub
app/models/miq_request_workflow/dialog_field_validation.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
51%

Use filter_map instead.
Open

    missing_categories_names = missing_tags.collect do |category|
      begin
        Classification.lookup_by_name(category.to_s).description
      rescue StandardError
        nil

Wrap expressions with varying precedence with parentheses to avoid ambiguity.
Open

      error << _(". %{details}") % {:details => fld[:required_regex_fail_details]} if fld[:required_regex_fail_details]

Looks for expressions containing multiple binary operators where precedence is ambiguous due to lack of parentheses. For example, in 1 + 2 * 3, the multiplication will happen before the addition, but lexically it appears that the addition will happen first.

The cop does not consider unary operators (ie. !a or -b) or comparison operators (ie. a =~ b) because those are not ambiguous.

NOTE: Ranges are handled by Lint/AmbiguousRange.

Example:

# bad
a + b * c
a || b && c
a ** b + c

# good (different precedence)
a + (b * c)
a || (b && c)
(a ** b) + c

# good (same precedence)
a + b + c
a * b / c % d

There are no issues that match your filters.

Category
Status