codeRIT/hackathon_manager

View on GitHub
app/models/data_export.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use tr instead of gsub.
Open

    time = created_at.strftime("%r").gsub(":", "-")
Severity: Minor
Found in app/models/data_export.rb by rubocop

This cop identifies places where gsub can be replaced by tr or delete.

Example:

# bad
'abc'.gsub('b', 'd')
'abc'.gsub('a', '')
'abc'.gsub(/a/, 'd')
'abc'.gsub!('a', 'd')

# good
'abc'.gsub(/.*/, 'a')
'abc'.gsub(/a+/, 'd')
'abc'.tr('b', 'd')
'a b c'.delete(' ')

Extra empty line detected at class body beginning.
Open


  # A DataExport is a generated .zip of data from HackathonManager, such as a .zip of
Severity: Minor
Found in app/models/data_export.rb by rubocop

This cop checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: Enforcedstyle: beginning_only

# good

class Foo

  def bar
    # ...
  end
end

Example: Enforcedstyle: ending_only

# good

class Foo
  def bar
    # ...
  end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Avoid comma after the last item of an array.
Open

    "sponsor_dump_checked_in",
Severity: Minor
Found in app/models/data_export.rb by rubocop

This cop checks for trailing comma in array literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

There are no issues that match your filters.

Category
Status