Showing 400 of 533 total issues
Method getAttributesWithPropagated
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private void
getAttributesWithPropagated(List<Attr> attributes, Attr attr)
{
boolean newAttribute = true;
Iterator<Attr[]> iter = c14nAttrStack.iterator();
- 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 handleParent
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected void
handleParent(Element e, NameSpaceSymbTable ns)
{
if (!e.hasAttributes() && e.getNamespaceURI() == null) {
- 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 logicalNextDOMTextNode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private Node
logicalNextDOMTextNode(Node n)
{
Node p = n.getNextSibling();
if (p == null) {
- 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 writeStringToUtf8
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static void
writeStringToUtf8(
final String str,
final OutputStream out
) throws IOException
- 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 nth
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def nth(node, options = {})
unless node.value.size == 4
raise(ArgumentError, "expected an+b node to contain 4 tokens, but is #{node.value.inspect}")
end
- 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 adoptAs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected IRubyObject
adoptAs(ThreadContext context, AdoptScheme scheme, IRubyObject other_)
{
final XmlNode other = asXmlNode(context, other_);
// this.doc might be null since this node can be empty node.
Method getStringInUtf8
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static byte[]
getStringInUtf8(final String str)
{
final int length = str.length();
boolean expanded = false;
Method circumventBug2650internal
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("fallthrough")
private static void
circumventBug2650internal(Node node)
{
Node parent = null;
Method createXmlModule
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private RubyClass
createXmlModule(Ruby ruby, RubyModule xmlModule)
{
RubyClass node = xmlModule.defineClassUnder("Node", ruby.getObject(), XML_NODE_ALLOCATOR);
node.defineAnnotatedMethods(XmlNode.class);
Method lookupNamespaceURI
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public String
lookupNamespaceURI(String specifiedPrefix)
{
short type = this.getNodeType();
switch (type) {
Method canonicalize
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
@JRubyMethod(optional = 3)
public IRubyObject
canonicalize(ThreadContext context, IRubyObject[] args, Block block)
{
int mode = 0;
Method compare
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public int
compare(Attr attr0, Attr attr1)
{
String namespaceURI0 = attr0.getNamespaceURI();
String namespaceURI1 = attr1.getNamespaceURI();
- 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 handleParent
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected void
handleParent(Element e, NameSpaceSymbTable ns)
{
if (!e.hasAttributes() && e.getNamespaceURI() == null) {
- 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 adoptAs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected IRubyObject
adoptAs(ThreadContext context, AdoptScheme scheme, IRubyObject other_)
{
final XmlNode other = asXmlNode(context, other_);
// this.doc might be null since this node can be empty node.
- 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 getAttrsAndNamespaces
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private Attr[]
getAttrsAndNamespaces(Element element)
{
NamedNodeMap attrs = element.getAttributes();
if (!canonical) {
- 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 parse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse(string_or_io, options = nil)
##
# When the current node is unparented and not an element node, use the
# document as the parsing context instead. Otherwise, the in-context
# parser cannot find an element or a document node.
- 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 reencode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def reencode(body, content_type = nil)
if body.encoding == Encoding::ASCII_8BIT
encoding = nil
# look for a Byte Order Mark (BOM)
- 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 startElement
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void
startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException
{
final Ruby runtime = this.runtime;
Method handleAttributesSubtree
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected Iterator<Attr>
handleAttributesSubtree(Element element, NameSpaceSymbTable ns)
throws CanonicalizationException
{
Method getDTMHandleFromNode
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public /* synchronized */ int
getDTMHandleFromNode(org.w3c.dom.Node node)
{
//if (node == null) // "node must be non-null for getDTMHandleFromNode!");