am-kantox/see_as_vee

View on GitHub
lib/see_as_vee/sheet.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use params[:col_sep] = "\t" instead of params.merge!(col_sep: "\t").
Open

      params.merge!(col_sep: "\t") if for_ms_excel
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

This cop identifies places where Hash#merge! can be replaced by Hash#[]=.

Example:

hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash.merge!(a: 1, b: 2)

Place the . on the next line, together with the method name.
Open

        gsub(/[[:space:]]+\z/, '').
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

This cop checks the . position in multi-line method calls.

Example: EnforcedStyle: leading (default)

# bad
something.
  mehod

# good
something
  .method

Example: EnforcedStyle: trailing

# bad
something
  .method

# good
something.
  mehod

Place the . on the next line, together with the method name.
Open

        gsub(/\A[[:space:]]+/, '').
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

This cop checks the . position in multi-line method calls.

Example: EnforcedStyle: leading (default)

# bad
something.
  mehod

# good
something
  .method

Example: EnforcedStyle: trailing

# bad
something
  .method

# good
something.
  mehod

Place the . on the next line, together with the method name.
Open

      str.
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

This cop checks the . position in multi-line method calls.

Example: EnforcedStyle: leading (default)

# bad
something.
  mehod

# good
something
  .method

Example: EnforcedStyle: trailing

# bad
something
  .method

# good
something.
  mehod

Shadowing outer local variable - f.
Open

        File.open(f.path, mode) { |f| f.write content }
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

This cop looks for use of the same name as outer local variables for block arguments or block local variables. This is a mimic of the warning "shadowing outer local variable - foo" from ruby -cw.

Example:

# bad

def some_method
  foo = 1

  2.times do |foo| # shadowing outer `foo`
    do_something(foo)
  end
end

Example:

# good

def some_method
  foo = 1

  2.times do |bar|
    do_something(bar)
  end
end

Avoid multi-line chains of blocks.
Open

      end.compact.map.with_index do |row, idx|
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

This cop checks for chaining of a block after another block that spans multiple lines.

Example:

Thread.list.find_all do |t|
  t.alive?
end.map do |t|
  t.object_id
end

Favor a normal if-statement over a modifier clause in a multiline statement.
Open

        content =
          "\xFF\xFE".force_encoding(Encoding::UTF_16LE) <<
          content.encode(Encoding::UTF_16LE) if for_ms_excel
Severity: Minor
Found in lib/see_as_vee/sheet.rb by rubocop

Checks for uses of if/unless modifiers with multiple-lines bodies.

Example:

# bad
{
  result: 'this should not happen'
} unless cond

# good
{ result: 'ok' } if cond

There are no issues that match your filters.

Category
Status