abhishekkr/rubygem_xml_motor

View on GitHub

Showing 5 of 5 total issues

Method pre_processed_content has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def self.pre_processed_content(_nodes, _tags=nil, tag_to_find=nil,
            attrib_to_find=nil, with_tag=false, just_attrib_val=nil)
Severity: Minor
Found in lib/xml-motor/xml-motor-engine.rb - About 45 mins to fix

    Method xmldata has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def self.xmldata(nodes, tags=nil, tag_to_find=nil, attrib_to_find=nil, with_tag=false)
    Severity: Minor
    Found in lib/xml-motor.rb - About 35 mins to fix

      Method xmlattrib has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def self.xmlattrib(attrib_key, nodes, tags=nil, tag_to_find=nil, attrib_to_find=nil)
      Severity: Minor
      Found in lib/xml-motor.rb - About 35 mins to fix

        Method xmlattrib has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.xmlattrib(attrib_key, nodes, tags=nil, tag_to_find=nil, attrib_to_find=nil)
            unless tag_to_find.nil? && attrib_to_find.nil?
              attribs = XMLMotorEngine.pre_processed_content nodes, tags, tag_to_find, attrib_to_find, false, attrib_key
            else
              attribs = XMLMotorEngine.pre_processed_content nodes, tags, tag_to_find, attrib_key, false, attrib_key
        Severity: Minor
        Found in lib/xml-motor.rb - About 25 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 xml_extracter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.xml_extracter(tag_to_find=nil, attrib_to_find=nil, with_tag=false,
                                just_attrib_val=nil)
            index_to_find = []
            if attrib_to_find.nil? and tag_to_find.nil?
              return nil
        Severity: Minor
        Found in lib/xml-motor/xml-motor-engine.rb - About 25 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