Showing 145 of 177 total issues
Method sql_make_where
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def sql_make_where(arr_terms, _driver = nil)
sql = ""
first = true
arr_terms.each do |key, value|
- 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 update_sql
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_sql
sql = "UPDATE OR IGNORE #{@db.quote_table(@table_name)} SET "
first = true
@updates.each do |key, value|
- 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 where_sql
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def where_sql
return if @wheres.empty?
sql = " WHERE"
- 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 clone_insert_from_original_table
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def clone_insert_from_original_table(newname, columns_list)
sql_clone = "INSERT INTO #{@db.quote_table(newname)} ("
first = true
columns_list.each do |column_data|
- 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 insert_sql
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def insert_sql
sql = "INSERT OR IGNORE INTO #{@db.quote_table(@table_name)} ("
combined_data = @updates.merge(@terms)
- 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 query
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def query(string, args = nil, &block)
if @debug
print "SQL: #{string}\n"
if @debug.class.name == "Fixnum" && @debug >= 2
- 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 columns
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def columns(args = nil)
@db.columns
ret = []
sql = "SHOW FULL COLUMNS FROM #{@db.quote_table(name)}"
sql << " WHERE `Field` = '#{@db.esc(args.fetch(:name))}'" if args && args.key?(:name)
- 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 insert_sql
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def insert_sql
sql = "INSERT INTO #{@db.quote_table(@table_name)} ("
combined_data = @updates.merge(@terms)
- 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 reconnect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reconnect
@mutex.synchronize do
require "mysql2" unless ::Object.const_defined?(:Mysql2)
args = {
Method flush_real
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def flush_real(db = nil)
return nil if @queries_count <= 0
db = @db if db == nil
@lock.synchronize do
Method create_column_programmatic
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_column_programmatic(col_data)
temp_name = "temptable_#{Time.now.to_f.to_s.hash}"
clone(temp_name)
cols_cur = columns
@db.query("DROP TABLE `#{name}`")
Method fetch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch
if @enum
begin
ret = @enum.next
rescue StopIteration
Method data_sql
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def data_sql(data)
data.each_key do |key|
raise "Invalid key: '#{key}' (#{key.class.name})." unless DATA_SQL_ALLOWED_KEYS.include?(key)
end
Method columns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def columns(args = nil)
@db.columns
ret = []
sql = "SHOW FULL COLUMNS FROM #{@db.quote_table(name)}"
sql << " WHERE `Field` = '#{@db.esc(args.fetch(:name))}'" if args && args.key?(:name)
Method type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def type
unless @type
if (match = @data.fetch(:Type).match(/^([A-z]+)$/))
@maxlength = false
@type = match[0].to_sym
- 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 indexes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def indexes(args = {})
where_args = {
tablename: name
}
- 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 insert_and_register_conflict
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def insert_and_register_conflict
@db.query(insert_sql)
@db.last_id if @return_id
rescue => e
if (match = e.message.match(/Key \((.+)\)=\((.+)\) already exists/))
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def execute
# Give 'cloned_ubuf' argument to 'q'-method.
if @args
@args_q = {cloned_ubuf: true} if @args[:cloned_ubuf]
@args_q = {unbuffered: true} if @args[:unbuffered]
- 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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(args)
args = {time: args} if args.is_a?(String)
raise "Invalid arguments given: #{args}" unless args.is_a?(Hash)
raise "No time given." unless args[:time]
- 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 register_thread
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def register_thread
raise "Baza-object is not in threadding mode" unless @conns
thread_cur = Thread.current
tid = __id__
- 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"