Dalphi/dalphi

View on GitHub

Showing 1,441 of 1,441 total issues

Use normalcase for variable numbers.
Open

      interface_type_1 = FactoryGirl.create(:interface_type)
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

This cop makes sure that all numbered variables use the configured style, snakecase, normalcase or noninteger, for their numbering.

Example: EnforcedStyle: snake_case

# bad

variable1 = 1

# good

variable_1 = 1

Example: EnforcedStyle: normalcase (default)

# bad

variable_1 = 1

# good

variable1 = 1

Example: EnforcedStyle: non_integer

# bad

variable1 = 1

variable_1 = 1

# good

variableone = 1

variable_one = 1

Use %w or %W for an array of words.
Open

      expect(@project.associated_problem_identifiers.sort).to eq(['HyperNER', 'MegaNER', 'NER'].sort)
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

This cop can check for array literals made up of word-like strings, that are not using the %w() syntax.

Alternatively, it can check for uses of the %w() syntax, in projects which do not want to include that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of 3 will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%w[foo bar baz]

# bad
['foo', 'bar', 'baz']

Example: EnforcedStyle: brackets

# good
['foo', 'bar', 'baz']

# bad
%w[foo bar baz]

Line is too long. [105/80]
Open

      @interface.java_script = File.new("#{Rails.root}/spec/fixtures/interfaces/text_nominal_invalid.js")
Severity: Minor
Found in spec/models/interface_spec.rb by rubocop

Indent the right bracket the same as the first position after the preceding left parenthesis.
Open

      ])
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

This cop checks the indentation of the first element in an array literal where the opening bracket and the first element are on separate lines. The other elements' indentations are handled by the AlignArray cop.

By default, array literals that are arguments in a method call with parentheses, and where the opening square bracket of the array is on the same line as the opening parenthesis of the method call, shall have their first element indented one step (two spaces) more than the position inside the opening parenthesis.

Other array literals shall have their first element indented one step more than the start of the line where the opening square bracket is.

This default style is called 'specialinsideparentheses'. Alternative styles are 'consistent' and 'align_brackets'. Here are examples:

Example: EnforcedStyle: specialinsideparentheses (default)

# The `special_inside_parentheses` style enforces that the first
# element in an array literal where the opening bracket and first
# element are on seprate lines is indented one step (two spaces) more
# than the position inside the opening parenthesis.

#bad
array = [
  :value
]
and_in_a_method_call([
  :no_difference
                     ])

#good
array = [
  :value
]
but_in_a_method_call([
                       :its_like_this
                     ])

Example: EnforcedStyle: consistent

# The `consistent` style enforces that the first element in an array
# literal where the opening bracket and the first element are on
# seprate lines is indented the same as an array literal which is not
# defined inside a method call.

#bad
# consistent
array = [
  :value
]
but_in_a_method_call([
                       :its_like_this
])

#good
array = [
  :value
]
and_in_a_method_call([
  :no_difference
])

Example: EnforcedStyle: align_brackets

# The `align_brackets` style enforces that the opening and closing
# brackets are indented to the same position.

#bad
# align_brackets
and_now_for_something = [
                          :completely_different
]

#good
# align_brackets
and_now_for_something = [
                          :completely_different
                        ]

Line is too long. [89/80]
Open

    it 'should only connect thoses services where exactly one service per type exists' do
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Line is too long. [84/80]
Open

        common_project = @annotation_document_with_different_admin.raw_datum.project

Operator << should be surrounded by a single space.
Open

      @ml_service.interface_types  << interface_type_2
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Line is too long. [87/80]
Open

      interface_type_2 = FactoryGirl.create(:interface_type, name: 'regular_interface')
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

Line is too long. [87/80]
Open

                                                             name: 'regular_interface')
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

Use normalcase for variable numbers.
Open

      interface_type_1 = FactoryGirl.create(:interface_type, name: 'fancy_interface')
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

This cop makes sure that all numbered variables use the configured style, snakecase, normalcase or noninteger, for their numbering.

Example: EnforcedStyle: snake_case

# bad

variable1 = 1

# good

variable_1 = 1

Example: EnforcedStyle: normalcase (default)

# bad

variable_1 = 1

# good

variable1 = 1

Example: EnforcedStyle: non_integer

# bad

variable1 = 1

variable_1 = 1

# good

variableone = 1

variable_one = 1

Use Integer#times for a simple loop which iterates a fixed number of times.
Open

      (0..10).each do
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

This cop checks for loops which iterate a constant number of times, using a Range literal and #each. This can be done more readably using Integer#times.

This check only applies if the block takes no parameters.

Example:

# bad
(1..5).each { }

# good
5.times { }

Example:

# bad
(0...10).each {}

# good
10.times {}

%w-literals should be delimited by [ and ].
Open

      @interface.associated_problem_identifiers = %w(ner superNER)
Severity: Minor
Found in spec/models/interface_spec.rb by rubocop

This cop enforces the consistent usage of %-literal delimiters.

Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

Example:

# Style/PercentLiteralDelimiters:
#   PreferredDelimiters:
#     default: '[]'
#     '%i':    '()'

# good
%w[alpha beta] + %i(gamma delta)

# bad
%W(alpha #{beta})

# bad
%I(alpha beta)

Use 2 spaces for indentation in an array, relative to the first position after the preceding left parenthesis.
Open

        interface_type_1,
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

This cop checks the indentation of the first element in an array literal where the opening bracket and the first element are on separate lines. The other elements' indentations are handled by the AlignArray cop.

By default, array literals that are arguments in a method call with parentheses, and where the opening square bracket of the array is on the same line as the opening parenthesis of the method call, shall have their first element indented one step (two spaces) more than the position inside the opening parenthesis.

Other array literals shall have their first element indented one step more than the start of the line where the opening square bracket is.

This default style is called 'specialinsideparentheses'. Alternative styles are 'consistent' and 'align_brackets'. Here are examples:

Example: EnforcedStyle: specialinsideparentheses (default)

# The `special_inside_parentheses` style enforces that the first
# element in an array literal where the opening bracket and first
# element are on seprate lines is indented one step (two spaces) more
# than the position inside the opening parenthesis.

#bad
array = [
  :value
]
and_in_a_method_call([
  :no_difference
                     ])

#good
array = [
  :value
]
but_in_a_method_call([
                       :its_like_this
                     ])

Example: EnforcedStyle: consistent

# The `consistent` style enforces that the first element in an array
# literal where the opening bracket and the first element are on
# seprate lines is indented the same as an array literal which is not
# defined inside a method call.

#bad
# consistent
array = [
  :value
]
but_in_a_method_call([
                       :its_like_this
])

#good
array = [
  :value
]
and_in_a_method_call([
  :no_difference
])

Example: EnforcedStyle: align_brackets

# The `align_brackets` style enforces that the opening and closing
# brackets are indented to the same position.

#bad
# align_brackets
and_now_for_something = [
                          :completely_different
]

#good
# align_brackets
and_now_for_something = [
                          :completely_different
                        ]

Line is too long. [99/80]
Open

    it 'should return a set of different problem identifiers if associated services handle them' do
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Line is too long. [101/80]
Open

      expect(@project.associated_problem_identifiers.sort).to eq(['HyperNER', 'MegaNER', 'NER'].sort)
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Redundant curly braces around a hash parameter.
Open

        {
          'text_nominal' => nil
        }
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

This cop checks for braces around the last parameter in a method call if the last parameter is a hash. It supports braces, no_braces and context_dependent styles.

Example: EnforcedStyle: braces

# The `braces` style enforces braces around all method
# parameters that are hashes.

# bad
some_method(x, y, a: 1, b: 2)

# good
some_method(x, y, {a: 1, b: 2})

Example: EnforcedStyle: no_braces (default)

# The `no_braces` style checks that the last parameter doesn't
# have braces around it.

# bad
some_method(x, y, {a: 1, b: 2})

# good
some_method(x, y, a: 1, b: 2)

Example: EnforcedStyle: context_dependent

# The `context_dependent` style checks that the last parameter
# doesn't have braces around it, but requires braces if the
# second to last parameter is also a hash literal.

# bad
some_method(x, y, {a: 1, b: 2})
some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)

# good
some_method(x, y, a: 1, b: 2)
some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})

Line is too long. [118/80]
Open

                                                                  interface_type: @annotation_document.interface_type)

Extra blank line detected.
Open


      interface_type_2 = FactoryGirl.create(:interface_type, name: 'regular_interface')
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Line is too long. [89/80]
Open

        @merge_service.problem_id = (0...15).map { alphabet[rand(alphabet.length)] }.join
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

Line is too long. [87/80]
Open

      interface_type_2 = FactoryGirl.create(:interface_type, name: 'regular_interface')
Severity: Minor
Found in spec/models/service_spec.rb by rubocop
Severity
Category
Status
Source
Language