Dalphi/dalphi

View on GitHub

Showing 1,441 of 1,441 total issues

Use normalcase for variable numbers.
Open

        test_string_1 = 'The company Implisense GmbH in Berlin.'

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

Line is too long. [91/80]
Open

    it 'can consist of a combination of letters, numbers, dots, hyphens and underscores' do
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

Line is too long. [85/80]
Open

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

Align ) with (.
Open

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

This cops checks the indentation of hanging closing parentheses in method calls, method definitions, and grouped expressions. A hanging closing parenthesis means ) preceded by a line break.

Example:

# good: when x is on its own line, indent this way
func(
  x,
  y
)

# good: when x follows opening parenthesis, align parentheses
a = b * (x +
         y
        )

# bad
def func(
  x,
  y
  )
end

Line is too long. [99/80]
Open

    it 'should return a singleton if all associated services handle the same problem identifier' do
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Line is too long. [93/80]
Open

      @project.iterate_service = FactoryGirl.create(:iterate_service, problem_id: 'HyperNER')
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Line is too long. [86/80]
Open

      FactoryGirl.create(:merge_service, url: 'http://yet-another-dalphi-service.com')
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Line is too long. [84/80]
Open

                                                      other_interface.interface_type
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Use normalcase for variable numbers.
Open

      interface_type_3 = FactoryGirl.create(:interface_type_other)
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

Redundant curly braces around a hash parameter.
Open

        {
          'id' => (raw_datum.id + 1),
          'data' => Base64.encode64('{"new":"content"}')
        }
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. [100/80]
Open

      alphabet = [('a'..'z'), ('A'..'Z'), (0..9)].map { |i| i.to_a }.flatten.concat(['_', '-', '.'])
Severity: Minor
Found in spec/models/service_spec.rb by rubocop

Align the parameters of a method call if they span more than one line.
Open

        filename: 'file1.md',
        project: @raw_datum.project
Severity: Minor
Found in spec/models/raw_datum_spec.rb by rubocop

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
Open

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

This cop checks that the closing brace in a method call is either on the same line as the last method argument, or a new line.

When using the symmetrical (default) style:

If a method call's opening brace is on the same line as the first argument of the call, then the closing brace should be on the same line as the last argument of the call.

If an method call's opening brace is on the line above the first argument of the call, then the closing brace should be on the line below the last argument of the call.

When using the new_line style:

The closing brace of a multi-line method call must be on the line after the last argument of the call.

When using the same_line style:

The closing brace of a multi-line method call must be on the same line as the last argument of the call.

Example:

# symmetrical: bad
  # new_line: good
  # same_line: bad
  foo(a,
    b
  )

  # symmetrical: bad
  # new_line: bad
  # same_line: good
  foo(
    a,
    b)

  # symmetrical: good
  # new_line: bad
  # same_line: good
  foo(a,
    b)

  # symmetrical: good
  # new_line: good
  # same_line: bad
  foo(
    a,
    b
  )

Line is too long. [94/80]
Open

                                             associated_problem_identifiers: %w(ner ultraNER))
Severity: Minor
Found in spec/models/interface_spec.rb by rubocop

Line is too long. [97/80]
Open

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

%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)

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

                                             associated_problem_identifiers: %w(ner ultraNER))
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)

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. [82/80]
Open

                                                  url: 'http://www.3antworten.de',
Severity: Minor
Found in spec/models/project_spec.rb by rubocop

Redundant curly braces around a hash parameter.
Open

        {
          'id' => raw_datum.id,
          'data' => Base64.encode64('{"new":"content"}')
        }
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})
Severity
Category
Status
Source
Language