Showing 7 of 10 total issues
File lexical_string_conversion.rb
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bigdecimal'
module Saxon
class ItemType
# A collection of lamba-like objects for converting Ruby values into
Method load!
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def load!(saxon_home = nil)
return false if instance_variable_defined?(:@saxon_loaded) && @saxon_loaded
LOAD_SEMAPHORE.synchronize do
if Saxon::S9API.const_defined?(:Processor)
false
- 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 Source
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Source
# Helper methods for getting Java-useful representations of source document
# strings and files
module Helpers
# Given a File, or IO object which will return either #path or
Method Item
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.Item(item)
case item
when Value, AtomicValue, Node, Array, Map, ExternalObject
item
when Saxon::S9API::XdmNode
Method format_types
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def format_types(typelist, brackets = true)
return unless typelist.is_a?(Array)
list = typelist.map { |type|
case type
when JAVA_TYPE_MATCHER
- 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 comparator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def comparator(other)
->(cmp, i) {
return cmp unless cmp == 0
mine = self.components[i].nil? ? 0 : self.components[i]
- 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 linkify
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def linkify(*args)
if args.first.is_a?(String)
case args.first
when JAVA_TYPE_MATCHER
link = url_for_java_object(args.first)
- 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"