ManageIQ/wim_parser

View on GitHub
lib/wim_parser.rb

Summary

Maintainability
A
1 hr
Test Coverage
A
98%

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

  def xml_data
    header_data = header

    xml = File.open(filename, "rb") do |f|
      f.seek(header_data["xml_data_offset"])
Severity: Minor
Found in lib/wim_parser.rb - About 1 hr to fix

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

        nt_time = nt_time / 10_000_000 - 11_644_495_200
    Severity: Minor
    Found in lib/wim_parser.rb by rubocop

    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