Showing 400 of 533 total issues
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 (specifiedPrefix == null &&
attr.getNodeName().equals("xmlns")) {
// default namespace
return value;
} else if (attrPrefix != null &&
Avoid deeply nested control flow statements. Open
if (node == elem) {
elemHandle = getHandleFromNode(elem);
break;
}
Avoid deeply nested control flow statements. Open
if (NName.equals("id")) {
if (isRealVisible) {
// treat xml:id like any other attribute
// (emit it, but don't inherit it)
result.add(attribute);
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
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 inspect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def inspect
# handle the case where an exception is thrown during object construction
if respond_to?(:data_ptr?) && !data_ptr?
return "#<#{self.class}:#{format("0x%x", object_id)} (no data)>"
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 read_and_encode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_and_encode(string, encoding)
# Read the string with the given encoding.
if string.respond_to?(:read)
string = if encoding.nil?
string.read
- 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
Consider simplifying this complex logical expression. Open
if Nokogiri.jruby?
save_options = options[:save_with] || options[1]
indent_times = options[:indent] || 0
else
save_options = options[:save_with] || options[1] || SaveOptions::FORMAT
Consider simplifying this complex logical expression. Open
if Nokogiri.jruby?
save_options = options[:save_with] || options[1]
indent_times = options[:indent] || 0
else
save_options = options[:save_with] || options[1] || XML::Node::SaveOptions::FORMAT
Method resolveResource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
resolveResource(String type,
String namespaceURI,
String publicId,
String systemId,
String baseURI)
Method canonicalizeSubTree
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Node currentNode, NameSpaceSymbTable ns, Node endnode, int documentLevel, CanonicalFilter filter
Method resolveEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
resolveEntity(Ruby runtime, String name, String publicId, String baseURI, String systemId)
Method getSchema
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
getSchema(Source source,
String currentDir,
String scriptFileName,
SchemaErrorHandler errorHandler,
long parseOptions) throws SAXException
Method createTextNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
createTextNode(Ruby ruby, String content, int depth, Stack<String> langStack, Stack<String> xmlBaseStack)
Method HTML4
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HTML4(input, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block)
Method process_recipe
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_recipe(name, version, static_p, cross_p, cacheable_p = true)
Method start_element_namespace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) # rubocop:disable Metrics/ParameterLists
Method parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse(string, url = nil, encoding = nil, **options, &block)