sparklemotion/nokogiri

View on GitHub

Showing 400 of 533 total issues

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

  createImpl(Node owner, IRubyObject prefix, String prefixStr, IRubyObject href, String hrefStr)
Severity: Minor
Found in ext/java/nokogiri/XmlNamespace.java - About 35 mins to fix

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

          def parse(thing, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block)
    Severity: Minor
    Found in lib/nokogiri/xml.rb - About 35 mins to fix

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

        newEmpty(Ruby runtime,
                 Document doc,
                 IRubyObject name,
                 IRubyObject external_id,
                 IRubyObject system_id)
      Severity: Minor
      Found in ext/java/nokogiri/XmlDtd.java - About 35 mins to fix

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

              def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) # rubocop:disable Metrics/ParameterLists
        Severity: Minor
        Found in lib/xsd/xmlparser/nokogiri.rb - About 35 mins to fix

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

                def parse(input, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block)
          Severity: Minor
          Found in lib/nokogiri/html4.rb - About 35 mins to fix

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

                  def xpath_impl(node, path, handler, ns, binds)
            Severity: Minor
            Found in lib/nokogiri/xml/searchable.rb - About 35 mins to fix

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

                    def xpath_internal(node, paths, handler, ns, binds)
              Severity: Minor
              Found in lib/nokogiri/xml/searchable.rb - About 35 mins to fix

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

                  def self.HTML5(input, url = nil, encoding = nil, **options, &block)
                Severity: Minor
                Found in lib/nokogiri/html5.rb - About 35 mins to fix

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

                          def parse(string_or_io, url = nil, encoding = nil, **options, &block)
                  Severity: Minor
                  Found in lib/nokogiri/html5/document.rb - About 35 mins to fix

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

                        def XML(thing, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_XML, &block)
                    Severity: Minor
                    Found in lib/nokogiri/xml.rb - About 35 mins to fix

                      Method adoptAsChild has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private Node[]
                        adoptAsChild(final Node parent, Node otherNode)
                        {
                          /*
                           * This is a bit of a hack.  C-Nokogiri allows adding a bare text node as the root element.
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlNode.java - About 35 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 getTextContentRecursively has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private static StringBuilder
                        getTextContentRecursively(StringBuilder buffer, Node currentNode)
                        {
                          CharSequence textContent = currentNode.getNodeValue();
                          if (textContent != null && NokogiriHelpers.shouldDecode(currentNode)) {
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlNode.java - About 35 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 transform has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        @JRubyMethod(rest = true, required = 1, optional = 2)
                        public IRubyObject
                        transform(ThreadContext context, IRubyObject[] args)
                        {
                          Ruby runtime = context.getRuntime();
                      Severity: Minor
                      Found in ext/java/nokogiri/XsltStylesheet.java - About 35 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 selectNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        public static Element
                        selectNode(Node sibling, String uri, String nodeName, int number)
                        {
                          while (sibling != null) {
                            if (sibling.getNamespaceURI() != null && sibling.getNamespaceURI().equals(uri)
                      Severity: Minor
                      Found in ext/java/nokogiri/internals/c14n/XMLUtils.java - About 35 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 root_set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        @JRubyMethod(name = "root=")
                        public IRubyObject
                        root_set(ThreadContext context, IRubyObject new_root)
                        {
                          // in case of document fragment, temporary root node should be deleted.
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlDocument.java - About 35 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 getElements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private static List<Node>
                        getElements(Node node, final boolean firstOnly)
                        {
                          NodeList children = node.getChildNodes();
                          if (children.getLength() == 0) {
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlNode.java - About 35 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 commonElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void
                          commonElement(QName element, XMLAttributes attrs, boolean isEmpty)
                          {
                            String qName = element.rawname;
                            String uri = element.uri;
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlReader.java - About 35 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 findSubElements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        protected static List<String>
                        findSubElements(HTMLElements.Element elem)
                        {
                          List<String> subs = subElements.get(elem.code);
                      
                      
                      Severity: Minor
                      Found in ext/java/nokogiri/Html4ElementDescription.java - About 35 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 isNamespaceDefined has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private static boolean
                        isNamespaceDefined(String qName, NamedNodeMap nodeMap)
                        {
                          if (isNamespace(qName.intern())) { return true; }
                          for (int i = 0; i < nodeMap.getLength(); i++) {
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlDocumentFragment.java - About 35 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 acceptChildren has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        void
                        acceptChildren(ThreadContext context, IRubyObject[] nodes, SaveContextVisitor visitor)
                        {
                          if (nodes.length > 0) {
                            for (int i = 0; i < nodes.length; i++) {
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlNode.java - About 35 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