Showing 5 of 5 total issues
File functions.rb
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require_relative 'function'
module Ronin
module Code
module SQL
Class Emitter
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Emitter
# The case to use when emitting keywords
#
# @return [:lower, :upper, :random, nil]
Method to_sql
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_sql(terminate: false, **kwargs)
emitter = emitter(**kwargs)
sql = @expression.to_sql(**kwargs)
unless clauses.empty?
- 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 emit_statement
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def emit_statement(stmt)
sql = emit_keyword(stmt.keyword)
unless stmt.argument.nil?
sql << @space << case stmt.argument
- 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 export_set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def export_set(bits,on,off,separator=nil,number_of_bits=nil)