Showing 400 of 537 total issues
Method enter
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public boolean
enter(Node node)
{
if (node instanceof Document) {
return enter((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 tryGetCharsetFromHtml5MetaTag
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private static String
tryGetCharsetFromHtml5MetaTag(Document document)
{
if (!"html".equalsIgnoreCase(document.getDocumentElement().getNodeName())) { return null; }
NodeList list = document.getDocumentElement().getChildNodes();
- 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 canonicalize
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod(optional = 3)
public IRubyObject
canonicalize(ThreadContext context, IRubyObject[] args, Block block)
{
int mode = 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 isEqualNode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public boolean
isEqualNode(Node arg)
{
if (arg == this) {
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"
Further reading
File XmlElementContent.java
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
package nokogiri;
import static nokogiri.internals.NokogiriHelpers.getLocalPart;
import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
import static nokogiri.internals.NokogiriHelpers.getPrefix;
File XsltStylesheet.java
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
package nokogiri;
import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
import static nokogiri.internals.NokogiriHelpers.stringOrBlank;
Method handleAttributes
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected final Iterator<Attr>
handleAttributes(Element element, NameSpaceSymbTable ns)
throws CanonicalizationException
{
Method leave
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public void
leave(Node node)
{
if (node instanceof Document) {
leave((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 getXmlnsAttr
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
void
getXmlnsAttr(Collection<Attr> col) throws CanonicalizationException
{
int size = levels.size() - 1;
if (cur == null) {
File xpath_visitor.rb
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Nokogiri
module CSS
# When translating CSS selectors to XPath queries with Nokogiri::CSS.xpath_for, the XPathVisitor
# class allows for changing some of the behaviors related to builtin xpath functions and quirks
# of HTML5.
Method to_hash
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_hash
header_directory = File.expand_path(File.join(File.dirname(__FILE__), "../../../ext/nokogiri"))
{}.tap do |vi|
vi["warnings"] = []
Method addNamespaceDeclIfNeeded
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private static String
addNamespaceDeclIfNeeded(XmlDocument doc, String tags)
{
if (doc.getDocument() == null) { return tags; }
if (doc.getDocument().getDocumentElement() == null) { return tags; }
- 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 enter
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public boolean
enter(Element element)
{
if (canonical) {
c14nNodeList.add(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 handleAttributesSubtree
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected Iterator<Attr>
handleAttributesSubtree(Element element, NameSpaceSymbTable ns)
throws CanonicalizationException
{
- 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 handleAttributesSubtree
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected Iterator<Attr>
handleAttributesSubtree(Element element, NameSpaceSymbTable ns)
throws CanonicalizationException
{
- 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 leave
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public void
leave(Element element)
{
if (canonical) {
c14nNamespaceStack.poll();
- 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 builtinCssClass
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private static boolean
builtinCssClass(List<?> args) throws XPathFunctionException
{
if (args.size() != 2) {
throw new XPathFunctionException("builtin function nokogiri:css-class takes two arguments");
- 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 pretty_print
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(pp)
nice_name = self.class.name.split("::").last
pp.group(2, "#(#{nice_name}:#{format("0x%x", object_id)} {", "})") do
pp.breakable
- 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
File DOM2DTMdefaultNamespaceDeclarationNode.java
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Method getStringInUtf8
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static byte[]
getStringInUtf8(final String str)
{
final int length = str.length();
boolean expanded = false;
- 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"