Showing 23 of 473 total issues
Class RecordSet
has 82 methods (exceeds 20 allowed). Consider refactoring. Open
class RecordSet < SimpleDelegator
extend Util::Forwardable
extend Cequel::Util::HashAccessors
include Enumerable
include BulkWrites
File record_set.rb
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Cequel
module Record
#
# This class represents a subset of records from a particular table. Record
# sets encapsulate a CQL query, and are constructed using a chained builder
Class DataSet
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class DataSet
include Enumerable
extend Util::Forwardable
# @return [Keyspace] keyspace that this data set's table resides in
Method migrate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def migrate
watch_stack = ActiveSupport::Dependencies::WatchStack.new
migration_table_names = Set[]
project_root = defined?(Rails) ? Rails.root : Dir.pwd
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Class Keyspace
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Keyspace
extend Util::Forwardable
include Logging
include MonitorMixin
File data_set.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'forwardable'
module Cequel
module Metal
#
Class Table
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Table
# @return [Symbol] the name of the table
attr_reader :name
File collection.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'delegate'
module Cequel
module Record
#
Method from_result_row
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.from_result_row(result_row)
if result_row
new.tap do |row|
result_row.each_pair do |name, value|
if name =~ /^(ttl|writetime)\((.+)\)$/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method migrate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def migrate
watch_stack = ActiveSupport::Dependencies::WatchStack.new
migration_table_names = Set[]
project_root = defined?(Rails) ? Rails.root : Dir.pwd
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 = {
Method sync_schema
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sync_schema
record_classes.each do |record_class|
begin
record_class.synchronize_schema
unless options[:quiet]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method write_attribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def write_attribute(name, value)
column = self.class.reflect_on_column(name)
fail UnknownAttributeError, "unknown attribute: #{name}" unless column
value = column.cast(value) unless value.nil?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method client_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def client_options
{hosts: hosts, port: port}.tap do |options|
options.merge!(credentials) if credentials
options.merge!(ssl_config) if ssl_config
options.merge!(compression: client_compression) if client_compression
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method []=
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def []=(*args)
if args[0].is_a?(Integer) && args.count == 2
# single element set/replace
elem = cast_element(args[1])
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method key
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def key(name, type, options = {})
def_accessors(name)
if options.fetch(:auto, false)
unless Type[type].is_a?(Cequel::Type::Uuid)
fail ArgumentError, ":auto option only valid for UUID columns"
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method find_rows_in_single_batch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_rows_in_single_batch(options = {})
if options.key?(:batch_size)
fail ArgumentError,
"Can't pass :batch_size argument with a limit in the scope"
else
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save(options = {})
super.tap do |success|
if success
if self.respond_to?(:changes_applied)
changes_applied
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method write_attribute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_attribute(name, value)
column = self.class.reflect_on_column(name)
fail UnknownAttributeError, "unknown attribute: #{name}" unless column
value = column.cast(value) unless value.nil?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method execute_stmt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute_stmt(keyspace)
retries_remaining = max_retries
begin
yield
rescue Cassandra::Errors::NoHostsAvailable,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"