Showing 400 of 537 total issues
Method index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def index(node = nil)
if node
warn("given block not used") if block_given?
each_with_index { |member, j| return j if member == node }
elsif block_given?
- 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 related_class
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def related_class(class_name)
klass = nil
inspecting = self.class
while inspecting
- 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 method_missing
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(method, *args, &block) # :nodoc:
if @context&.respond_to?(method)
@context.send(method, *args, &block)
else
node = @doc.create_element(method.to_s.sub(/[_!]$/, ""), *args) do |n|
- 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 engineCanonicalizeSubTree
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected byte[]
engineCanonicalizeSubTree(Node rootNode, Node excludeNode, CanonicalFilter filter)
throws CanonicalizationException
{
this.excludeNode = excludeNode;
Method outputTextToWriter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static final void
outputTextToWriter(
final String text, final OutputStream writer
) throws IOException
{
Method native_write_to
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@JRubyMethod(required = 4, visibility = Visibility.PRIVATE)
public IRubyObject
native_write_to(ThreadContext context, IRubyObject[] args)
{
Method logicalNextDOMTextNode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Node
logicalNextDOMTextNode(Node n)
{
Node p = n.getNextSibling();
if (p == null) {
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 parse_with
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod
public IRubyObject
parse_with(ThreadContext context, IRubyObject handlerRuby)
{
final Ruby runtime = context.getRuntime();
- 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 getOwnerDocument
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static Document
getOwnerDocument(Set<Node> xpathNodeSet)
{
NullPointerException npe = null;
for (Node node : xpathNodeSet) {
- 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 serializeAttrTextContent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static CharSequence
serializeAttrTextContent(String str, boolean htmlDoc)
{
if (str == null || str.length() == 0) { return ""; }
- 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 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 evaluate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod
public IRubyObject
evaluate(ThreadContext context, IRubyObject rbQuery, IRubyObject handler)
{
String query = rbQuery.convertToString().asJavaString();
- 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 engineCanonicalizeSubTree
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected byte[]
engineCanonicalizeSubTree(Node rootNode, Node excludeNode, CanonicalFilter filter)
throws CanonicalizationException
{
this.excludeNode = excludeNode;
- 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 setAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private void
setAttribute(ThreadContext context, String key, String val)
{
Element element = (Element) 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 node_type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod(name = {"node_type", "type"})
public IRubyObject
node_type(ThreadContext context)
{
String type;
- 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 removeNamespaceRecursively
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private void
removeNamespaceRecursively(XmlNode xmlNode)
{
Node node = xmlNode.node;
if (node.getNodeType() == Node.ELEMENT_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 getCachedNodeOrCreate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static IRubyObject
getCachedNodeOrCreate(Ruby runtime, Node node)
{
if (node == null) { return runtime.getNil(); }
if (node.getNodeType() == Node.ATTRIBUTE_NODE && isNamespace(node.getNodeName())) {
- 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 dispatchNodeData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("fallthrough")
protected static void
dispatchNodeData(Node node,
org.xml.sax.ContentHandler ch,
int depth)
- 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 isDescendantOrSelf
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static boolean
isDescendantOrSelf(Node ctx, Node descendantOrSelf)
{
if (ctx == descendantOrSelf) {
return true;
- 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"