cequel/cequel

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

Summary

Maintainability
A
1 hr
Test Coverage

Method create! has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def create!(options = {})
        bare_connection =
          Metal::Keyspace.new(keyspace.configuration.except(:keyspace))

        default_options = {
Severity: Minor
Found in lib/cequel/schema/keyspace.rb - About 1 hr to fix

    Unnecessary utf-8 encoding comment.
    Open

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

    Line is too long. [88/80]
    Open

          # @param exists [Boolean] if set to true, will drop only if exists (Cassandra 3.x)
    Severity: Minor
    Found in lib/cequel/schema/keyspace.rb by rubocop

    Space between { and | missing.
    Open

            patch.statements.each{|stmt| keyspace.execute(stmt) }
    Severity: Minor
    Found in lib/cequel/schema/keyspace.rb by rubocop

    Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that block braces have
    # surrounding space.
    
    # bad
    some_array.each {puts e}
    
    # good
    some_array.each { puts e }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that block braces don't
    # have surrounding space.
    
    # bad
    some_array.each { puts e }
    
    # good
    some_array.each {puts e}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # block braces don't have a space in between when empty.
    
    # bad
    some_array.each {   }
    some_array.each {  }
    some_array.each { }
    
    # good
    some_array.each {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # block braces have at least a spece in between when empty.
    
    # bad
    some_array.each {}
    
    # good
    some_array.each { }
    some_array.each {  }
    some_array.each {   }

    Example: SpaceBeforeBlockParameters: true (default)

    # The SpaceBeforeBlockParameters style set to `true` enforces that
    # there is a space between `{` and `|`. Overrides `EnforcedStyle`
    # if there is a conflict.
    
    # bad
    [1, 2, 3].each {|n| n * 2 }
    
    # good
    [1, 2, 3].each { |n| n * 2 }

    Example: SpaceBeforeBlockParameters: true

    # The SpaceBeforeBlockParameters style set to `false` enforces that
    # there is no space between `{` and `|`. Overrides `EnforcedStyle`
    # if there is a conflict.
    
    # bad
    [1, 2, 3].each { |n| n * 2 }
    
    # good
    [1, 2, 3].each {|n| n * 2 }

    Add an empty line after magic comments.
    Open

    module Cequel
    Severity: Minor
    Found in lib/cequel/schema/keyspace.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

    Line is too long. [83/80]
    Open

            keyspace.execute("DROP MATERIALIZED VIEW #{'IF EXISTS ' if exists}#{name}")
    Severity: Minor
    Found in lib/cequel/schema/keyspace.rb by rubocop

    Extra blank line detected.
    Open

    
          # Returns true iff the specified table name exists in the keyspace.
    Severity: Minor
    Found in lib/cequel/schema/keyspace.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

    Space missing to the left of {.
    Open

            patch.statements.each{|stmt| keyspace.execute(stmt) }
    Severity: Minor
    Found in lib/cequel/schema/keyspace.rb by rubocop

    Checks that block braces have or don't have a space before the opening brace depending on configuration.

    Example:

    # bad
    foo.map{ |a|
      a.bar.to_s
    }
    
    # good
    foo.map { |a|
      a.bar.to_s
    }

    Line is too long. [88/80]
    Open

          # @param exists [Boolean] if set to true, will drop only if exists (Cassandra 3.x)
    Severity: Minor
    Found in lib/cequel/schema/keyspace.rb by rubocop

    Use alias instead of alias_method in a class body.
    Open

          alias_method :synchronize_table, :sync_table
    Severity: Minor
    Found in lib/cequel/schema/keyspace.rb by rubocop

    This cop enforces the use of either #alias or #alias_method depending on configuration. It also flags uses of alias :symbol rather than alias bareword.

    Example: EnforcedStyle: prefer_alias (default)

    # bad
    alias_method :bar, :foo
    alias :bar :foo
    
    # good
    alias bar foo

    Example: EnforcedStyle: preferaliasmethod

    # bad
    alias :bar :foo
    alias bar foo
    
    # good
    alias_method :bar, :foo

    There are no issues that match your filters.

    Category
    Status