cequel/cequel

View on GitHub
lib/cequel/schema/table_updater.rb

Summary

Maintainability
A
0 mins
Test Coverage

Line is too long. [81/80]
Open

        add_stmt %Q|ALTER TABLE "#{table_name}" WITH #{properties.join(' AND ')}|
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

Add an empty line after magic comments.
Open

module Cequel
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Align .map with options on line 118.
Open

          .map { |name, value| TableProperty.build(name, value).to_cql }
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

This cop checks the indentation of the method name part in method calls that span more than one line.

Example: EnforcedStyle: aligned

# bad
while myvariable
.b
  # do something
end

# good
while myvariable
      .b
  # do something
end

# good
Thing.a
     .b
     .c

Example: EnforcedStyle: indented

# good
while myvariable
  .b

  # do something
end

Example: EnforcedStyle: indentedrelativeto_receiver

# good
while myvariable
        .a
        .b

  # do something
end

# good
myvariable = Thing
               .a
               .b
               .c

Line is too long. [86/80]
Open

        add_stmt %Q|ALTER TABLE "#{table_name}" RENAME "#{old_name}" TO "#{new_name}"|
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

Line is too long. [87/80]
Open

        add_stmt %Q|CREATE INDEX "#{index_name}" ON "#{table_name}" ("#{column_name}")|
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

Line is too long. [84/80]
Open

      def create_index(column_name, index_name = "#{table_name}_#{column_name}_idx")
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

%Q-literals should be delimited by ( and ).
Open

        add_stmt(%Q|ALTER TABLE #{table_name} ADD #{column.to_cql}|)
Severity: Minor
Found in lib/cequel/schema/table_updater.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)

Do not use parallel assignment.
Open

        @keyspace, @table_name = keyspace, table_name
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

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

%Q-literals should be delimited by ( and ).
Open

        add_stmt %Q|ALTER TABLE "#{table_name}" RENAME "#{old_name}" TO "#{new_name}"|
Severity: Minor
Found in lib/cequel/schema/table_updater.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)

%Q-literals should be delimited by ( and ).
Open

        add_stmt %Q|ALTER TABLE "#{table_name}" WITH #{properties.join(' AND ')}|
Severity: Minor
Found in lib/cequel/schema/table_updater.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)

%Q-literals should be delimited by ( and ).
Open

        add_stmt %Q|DROP INDEX IF EXISTS "#{index_name}"|
Severity: Minor
Found in lib/cequel/schema/table_updater.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)

%Q-literals should be delimited by ( and ).
Open

        add_stmt %Q|ALTER TABLE "#{table_name}" DROP "#{name}"|
Severity: Minor
Found in lib/cequel/schema/table_updater.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)

Unnecessary utf-8 encoding comment.
Open

# -*- encoding : utf-8 -*-
Severity: Minor
Found in lib/cequel/schema/table_updater.rb by rubocop

There are no issues that match your filters.

Category
Status