File ReaderNode.java
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
package nokogiri.internals;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
ReaderNode
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
public abstract class ReaderNode
{
final Ruby ruby;
public ReaderAttributeList attributeList;
Method getXmlBaseUri
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private String
getXmlBaseUri(String n, String v, Stack<String> xmlBaseStack)
{
if ("xml:base".equals(n)) {
if (v.startsWith("http://")) {
- 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 parseAttributes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private void
parseAttributes(XMLAttributes attrs, Stack<String> langStack, Stack<String> xmlBaseStack)
{
if (attrs.getLength() > 0) { attributeList = new ReaderAttributeList(); }
String u, n, v;
- 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 createElementNode
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
createElementNode(Ruby ruby, String uri, String localName, String qName, XMLAttributes attrs, int depth,
Stack<String> langStack, Stack<String> xmlBaseStack)
Method getAttributesNodes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public IRubyObject
getAttributesNodes()
{
RubyArray<?> array = RubyArray.newArray(ruby);
if (attributeList != null && attributeList.length > 0) {
- 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 createClosingNode
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
createClosingNode(Ruby ruby, String uri, String localName, String qName, int depth, Stack<String> langStack,
Stack<String> xmlBaseStack)
Method createTextNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
createTextNode(Ruby ruby, String content, int depth, Stack<String> langStack, Stack<String> xmlBaseStack)
Avoid too many return
statements within this method. Open
return v;
Avoid too many return
statements within this method. Open
return base.substring(0, pos).concat(sub);
Avoid too many return
statements within this method. Open
return null;