lib/miga/dataset.rb
Method has too many lines. [15/10] Open
Open
def initialize(project, name, is_ref = true, metadata = {})
name = name.to_s
name.miga_name? or
raise 'Invalid name, please use only alphanumerics and underscores: ' +
name
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for initialize is too high. [15.13/15] Open
Open
def initialize(project, name, is_ref = true, metadata = {})
name = name.to_s
name.miga_name? or
raise 'Invalid name, please use only alphanumerics and underscores: ' +
name
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Do not use parallel assignment. Open
Open
@project, @name, @metadata = project, name, nil
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for simple usages of parallel assignment. This will only complain when the number of variables being assigned matched the number of assigning variables.
Example:
# bad
a, b, c = 1, 2, 3
a, b, c = [1, 2, 3]
# good
one, two = *foo
a, b = foo()
a, b = b, a
a = 1
b = 2
c = 3
Use snake_case for method names. Open
Open
def INFO_FIELDS
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.
Example: EnforcedStyle: snake_case (default)
# bad
def fooBar; end
# good
def foo_bar; end
Example: EnforcedStyle: camelCase
# bad
def foo_bar; end
# good
def fooBar; end