Dalphi/dalphi

View on GitHub
app/models/annotation_document.rb

Summary

Maintainability
A
0 mins
Test Coverage

Block has too many lines. [44/25]
Open

  swagger_schema :AnnotationDocument do
    key :required,
        [
          :interface_type,
          :payload,
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Method has too many lines. [11/10]
Open

  def relevant_attributes
    {
      id: id,
      interface_type: interface_type.name,
      meta: meta,
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

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.

Line is too long. [91/80]
Open

            '{"label":"testlabel","options":["option1","option2"],"content":"testcontent"}'
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

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

    presence: true,
    uniqueness: { scope: :project }
Severity: Minor
Found in app/models/annotation_document.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

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

    allow_nil: true,
    numericality: {
      only_integer: true,
      greater_than_or_equal_to: 0
    }
Severity: Minor
Found in app/models/annotation_document.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

Line is too long. [84/80]
Open

      key :description, I18n.t('api.annotation_document.description.interface_type')
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

Missing top-level class documentation comment.
Open

class AnnotationDocument < ApplicationRecord
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Use %i or %I for an array of symbols.
Open

        [
          :interface_type,
          :payload,
          :raw_datum_id,
          :meta
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

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

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

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

Example: EnforcedStyle: brackets

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

# bad
%i[foo bar baz]

Line is too long. [82/80]
Open

      key :description, I18n.t('api.annotation_document.description.raw_datum_id')
Severity: Minor
Found in app/models/annotation_document.rb by rubocop

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

    presence: true
Severity: Minor
Found in app/models/annotation_document.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

There are no issues that match your filters.

Category
Status