Showing 537 of 537 total issues
Avoid deeply nested control flow statements. Open
if (!namespaceNs.equals(currentAttr.getNamespaceURI())) {
continue;
}
Method getContentImpl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public CharSequence
getContentImpl()
{
if (!node.hasChildNodes() && node.getNodeValue() == null &&
(node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.CDATA_SECTION_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
Avoid deeply nested control flow statements. Open
if (node == elem) {
elemHandle = getHandleFromNode(elem);
break;
}
Method call
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
call(String methodName,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
Avoid deeply nested control flow statements. Open
if (attr.isId() && id.equals(attr.getValue()) && se != knownElement) {
//log.debug("Multiple elements with the same 'Id' attribute value!");
return false;
}
Avoid deeply nested control flow statements. Open
if (childElement.hasAttributeNS(namespaceNs,
currentAttr.getLocalName())) {
continue;
}
Avoid deeply nested control flow statements. Open
if (rewriteTable == null) { rewriteTable = new HashMap<CharSequence, CharSequence>(8, 1); }
Method resolveResource
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public LSInput
resolveResource(String type,
String namespaceURI,
String publicId,
- 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 getAttrsOfAncestors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void
getAttrsOfAncestors(Node parent, List<Attr> namespaces, List<Attr> attributes)
{
if (parent == null) { return; }
NamedNodeMap attrs = parent.getAttributes();
- 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 findNamespaceHref
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private String
findNamespaceHref(ThreadContext context, String prefix)
{
XmlNode currentNode = this;
final XmlDocument doc = document(context.runtime);
- 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
Avoid deeply nested control flow statements. Open
if (prefix != null && !(prefix.equals(XML) || prefix.equals(XMLNS))) {
visiblyUtilized.add(prefix);
}
Method getNodeValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public String
getNodeValue(int nodeHandle)
{
// The _type(nodeHandle) call was taking the lion's share of our
// time, and was wrong anyway since it wasn't converting handle to
- 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
Avoid deeply nested control flow statements. Open
if (!m_processedFirstElement
&& "xmlns:xml".equals(attrs.item(i).getNodeName())) {
m_processedFirstElement = true;
}
Method getStrFromNode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static String
getStrFromNode(Node xpathnode)
{
if (xpathnode.getNodeType() == Node.TEXT_NODE) {
// we iterate over all siblings of the context node because eventually,
- 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
Avoid deeply nested control flow statements. Open
mk.sub!(/^PREFIX\s*=\s*$/, "PREFIX = #{host}-") if cross_build_p
Method configure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def configure
Dir.chdir(work_path) do
mk = File.read("win32/Makefile.gcc")
File.open("win32/Makefile.gcc", "wb") do |f|
f.puts "BINARY_PATH = #{path}/bin"
- 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 visit_attribute_condition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def visit_attribute_condition(node)
attribute = node.value.first.accept(self)
return attribute if node.value.length == 1
value = node.value.last
- 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 fromRubyToObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static Object
fromRubyToObject(final Ruby runtime, IRubyObject obj)
{
if (obj instanceof RubyString) { return obj.asJavaString(); }
if (obj instanceof RubyBoolean) { return obj.toJava(Boolean.class); }
- 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 stabilizeAttrs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static void
stabilizeAttrs(Node node)
{
if (node.hasAttributes()) {
NamedNodeMap nodeMap = node.getAttributes();
- 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
Avoid deeply nested control flow statements. Open
if darwin?
# needed as of zlib 1.2.13
Dir.chdir(work_path) do
makefile = File.read("Makefile").gsub(/^AR=.*$/, "AR=#{host}-libtool")
File.open("Makefile", "w") { |m| m.write(makefile) }