Showing 4 of 4 total issues
Method generate_axis
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_axis(axis)
tuples = axis.getPositions.map do |position|
members = position.getMembers.map do |raw_member|
member = ::Rubiks::Mondrian::Member.new(raw_member)
Method connect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def connect
::Rubiks::MondrianError.wrap_native_exception do
# hack to call private constructor of MondrianOlap4jDriver
# to avoid using DriverManager which fails to load JDBC drivers
# because of not seeing JRuby required jar files
Method connection_string
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def connection_string
string = "jdbc:mondrian:Jdbc=#{quote_string(jdbc_uri)};JdbcDrivers=#{jdbc_driver};"
# by default use content checksum to reload schema when catalog has changed
string << "UseContentChecksum=true;" unless @params[:use_content_checksum] == false
if role = @params[:role] || @params[:roles]
- 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 to_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_xml(builder = nil)
builder = builder || new_builder
xml_attrs = default_xml_attributes.merge(:hasAll => has_all.to_s)
xml_attrs[:primaryKey] = 'id' unless degenerate?
- 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"