dphaener/kanji

View on GitHub
lib/kanji/generators/type.rb

Summary

Maintainability
A
0 mins
Test Coverage

Align the operands of an expression in an assignment spanning multiple lines.
Open

        "      field :destroy#{class_name}, Types::#{class_name}[:destroy_mutation]\n"
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Do not use spaces between -> and opening brace in lambda literals
Open

          lookup_type: -> (name) { lookup_type(name) },
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

This cop checks for spaces between -> and opening parameter brace in lambda literals.

Example: EnforcedStyle: requirenospace (default)

# bad
  a = -> (x, y) { x + y }

  # good
  a = ->(x, y) { x + y }

Example: EnforcedStyle: require_space

# bad
  a = ->(x, y) { x + y }

  # good
  a = -> (x, y) { x + y }

Use \ instead of + or << to concatenate those strings.
Open

        "      field :update#{class_name}, Types::#{class_name}[:update_mutation]\n" +
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Line is too long. [124/100]
Open

        add_template("migration.rb.tt", "db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}_create_#{pluralized_type_name}.rb")
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

Line is too long. [104/100]
Open

        generator.processor.insert_into_file "./app/mutation_type.rb", fields, after: /description ".*"/
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

Keep a blank line before and after private.
Open

      private
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

Access modifiers should be surrounded by blank lines.

Example:

# bad
class Foo
  def bar; end
  private
  def baz; end
end

# good
class Foo
  def bar; end

  private

  def baz; end
end

Do not use spaces between -> and opening brace in lambda literals
Open

          lookup_column_type: -> (name) { lookup_column_type(name) }
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

This cop checks for spaces between -> and opening parameter brace in lambda literals.

Example: EnforcedStyle: requirenospace (default)

# bad
  a = -> (x, y) { x + y }

  # good
  a = ->(x, y) { x + y }

Example: EnforcedStyle: require_space

# bad
  a = ->(x, y) { x + y }

  # good
  a = -> (x, y) { x + y }

Align the operands of an expression in an assignment spanning multiple lines.
Open

        "      field :update#{class_name}, Types::#{class_name}[:update_mutation]\n" +
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Use \ instead of + or << to concatenate those strings.
Open

        fields = "\n\n      field :create#{class_name}, Types::#{class_name}[:create_mutation]\n" +
Severity: Minor
Found in lib/kanji/generators/type.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

There are no issues that match your filters.

Category
Status