lib/sequenceserver/blast/hit.rb
Do not use semicolons to terminate expressions. Open
Open
properties.inject({}) { |h, k| h[k] = send(k); h }.to_json(*args)
- Read upRead up
- Exclude checks
This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.
This cop has AllowAsExpressionSeparator
configuration option.
It allows ;
to separate several expressions on the same line.
Example:
# bad
foo = 1; bar = 2;
baz = 3;
# good
foo = 1
bar = 2
baz = 3
Example: AllowAsExpressionSeparator: false (default)
# bad
foo = 1; bar = 2
Example: AllowAsExpressionSeparator: true
# good
foo = 1; bar = 2
:length
member overrides Struct#length
and it may be unexpected. Open
Open
:length, :sciname, :qcovs, :hsps) do
- Read upRead up
- Exclude checks
This cop checks unexpected overrides of the Struct
built-in methods
via Struct.new
.
Example:
# bad
Bad = Struct.new(:members, :clone, :count)
b = Bad.new([], true, 1)
b.members #=> [] (overriding `Struct#members`)
b.clone #=> true (overriding `Object#clone`)
b.count #=> 1 (overriding `Enumerable#count`)
# good
Good = Struct.new(:id, :name)
g = Good.new(1, "foo")
g.members #=> [:id, :name]
g.clone #=> #<struct good id="1," name="foo">
g.count #=> 2</struct>