fidothe/saxon-rb

View on GitHub

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
Severity: Minor
Found in lib/saxon/item_type/lexical_string_conversion.rb - About 4 hrs to fix

    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
    Severity: Minor
    Found in lib/saxon/loader.rb - About 3 hrs to fix

    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
    Severity: Minor
    Found in lib/saxon/source.rb - About 2 hrs to fix

      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
      Severity: Minor
      Found in lib/saxon/xdm/item.rb - About 1 hr to fix

        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
        Severity: Minor
        Found in docs/templates/plugin.rb - About 55 mins to fix

        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]
        Severity: Minor
        Found in lib/saxon/version/library.rb - About 55 mins to fix

        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)
        Severity: Minor
        Found in docs/templates/plugin.rb - About 45 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language