Showing 400 of 533 total issues
Avoid too many return
statements within this method. Open
/*if (o instanceof XmlNode)*/ return ((XmlNode) obj).getNode();
Avoid too many return
statements within this method. Open
if (value.contains(encoding)) { return value; } // no need to replace
Avoid too many return
statements within this method. Open
return XmlNodeSet.newNodeSet(runtime, ((RubyArray) obj).toJavaArray());
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return obj.toJava(java.math.BigInteger.class);
Avoid too many return
statements within this method. Open
if (obj instanceof XmlNodeSet) { return obj; }
Avoid too many return
statements within this method. Open
if (format && element.getNextSibling() == null && element.hasChildNodes()) { return true; }
Method resolveNamespaceIfNecessary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void
resolveNamespaceIfNecessary(Node node, String default_href)
{
if (node == null) { return; }
String nodePrefix = node.getPrefix();
- 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 addMappingAndRender
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Node
addMappingAndRender(String prefix, String uri, Attr n)
{
NameSpaceSymbEntry ob = symb.get(prefix);
- 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 encoding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod
public IRubyObject
encoding(ThreadContext context)
{
if (this.encoding == null || this.encoding.isNil()) {
- 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 createElementForFamily
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static Element
createElementForFamily(Document doc, String namespace, String localName)
{
Element result;
String prefix = ElementProxy.getDefaultPrefix(namespace);
- 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 prefixStr2Set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static SortedSet<String>
prefixStr2Set(String inclusiveNamespaces)
{
SortedSet<String> prefixes = new TreeSet<String>();
- 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean
equals(final Object obj)
{
if (obj instanceof CacheKey) {
- 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 findEncodingName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static String
findEncodingName(ThreadContext context, IRubyObject encoding)
{
String rubyEncoding = null;
if (encoding instanceof RubyString) {
- 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 addMapping
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public boolean
addMapping(String prefix, String uri, Attr n)
{
NameSpaceSymbEntry ob = symb.get(prefix);
if ((ob != null) && uri.equals(ob.uri)) {
- 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 isVisibleDO
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected int
isVisibleDO(Node currentNode, int level)
{
if (nodeFilter != null) {
Iterator<NodeFilter> it = nodeFilter.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 getNamespacesAndAttrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void
getNamespacesAndAttrs(Node current, List<Attr> namespaces, List<Attr> attributes)
{
NamedNodeMap attrs = current.getAttributes();
for (int i = 0; i < attrs.getLength(); i++) {
- 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 get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod(visibility = Visibility.PRIVATE)
public IRubyObject
get(ThreadContext context, IRubyObject rbkey)
{
if (node instanceof Element) {
- 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 rbNew
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod(name = "new", meta = true, required = 1, optional = 3)
public static IRubyObject
rbNew(ThreadContext context, IRubyObject cls, IRubyObject[] args, Block block)
{
if (args.length < 1) {
- 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 index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected int
index(Object obj)
{
Object[] set = keys;
int length = set.length;
- 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"