Showing 400 of 537 total issues
Method enter
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean
enter(Node node)
{
if (node instanceof Document) {
return enter((Document)node);
Method populateNokogiriClassCache
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Map<String, RubyClass>
populateNokogiriClassCache(Ruby ruby)
{
Map<String, RubyClass> nokogiriClassCache = new HashMap<String, RubyClass>();
nokogiriClassCache.put("Nokogiri::HTML4::Document", (RubyClass)ruby.getClassFromPath("Nokogiri::HTML4::Document"));
Method getAttrsAndNamespaces
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Attr[]
getAttrsAndNamespaces(Element element)
{
NamedNodeMap attrs = element.getAttributes();
if (!canonical) {
Method protectAgainstWrappingAttack
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static boolean
protectAgainstWrappingAttack(
Node startNode, Element knownElement, String value
)
{
Method pretty_print
has 33 lines of code (exceeds 25 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
Method handleParent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void
handleParent(Element e, NameSpaceSymbTable ns)
{
if (!e.hasAttributes() && e.getNamespaceURI() == null) {
Method serializeAttrTextContent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static CharSequence
serializeAttrTextContent(String str, boolean htmlDoc)
{
if (str == null || str.length() == 0) { return ""; }
Method handleParent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void
handleParent(Element e, NameSpaceSymbTable ns)
{
if (!e.hasAttributes() && e.getNamespaceURI() == null) {
Method key_p
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod(name = {"key?", "has_attribute?"})
public IRubyObject
key_p(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 setUrl
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static void
setUrl(ThreadContext context, InputSource source, IRubyObject url)
{
String path = rubyStringToString(url);
// Dir.chdir might be called at some point before this.
- 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 getHandleFromNode
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public int
getHandleFromNode(Node node)
{
if (null != node) {
int len = m_nodes.size();
- 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 getSchema
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private Schema
getSchema(Source source, ThreadContext context)
{
InputStream is;
VerifierFactory factory = new com.thaiopensource.relaxng.jarv.VerifierFactoryImpl();
- 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 in_context
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@JRubyMethod(required = 2, visibility = Visibility.PRIVATE)
public IRubyObject
in_context(ThreadContext context, IRubyObject str, IRubyObject options)
{
RubyClass klass;
- 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 getStringValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public XMLString
getStringValue(int nodeHandle)
{
int type = getNodeType(nodeHandle);
- 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 ancestors
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ancestors(selector = nil)
return NodeSet.new(document) unless respond_to?(:parent)
return NodeSet.new(document) unless parent
parents = [parent]
- 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 extractDecls
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected void
extractDecls(ThreadContext context)
{
Ruby runtime = 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
Method extractDecls
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void
extractDecls(ThreadContext context)
{
Ruby runtime = context.runtime;
Method native_write
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@JRubyMethod
public IRubyObject
native_write(ThreadContext context, IRubyObject chunk,
IRubyObject isLast)
{
Method writeCharToUtf8
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void
writeCharToUtf8(final char c, final OutputStream out) throws IOException
{
if (c < 0x80) {
out.write(c);
Method transform
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@JRubyMethod(rest = true, required = 1, optional = 2)
public IRubyObject
transform(ThreadContext context, IRubyObject[] args)
{
Ruby runtime = context.getRuntime();