sparklemotion/nokogiri

View on GitHub

Showing 538 of 538 total issues

File XmlNode.java has 1408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package nokogiri;

import static java.lang.Math.max;
import static nokogiri.internals.NokogiriHelpers.*;

Severity: Major
Found in ext/java/nokogiri/XmlNode.java - About 3 days to fix

    Method getNodeCompletePath has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
    Open

      public static String
      getNodeCompletePath(Node node)
      {
    
        Node cur, tmp, next;
    Severity: Minor
    Found in ext/java/nokogiri/internals/NokogiriHelpers.java - About 2 days to fix

    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

    XmlNode has 109 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @JRubyClass(name = "Nokogiri::XML::Node")
    public class XmlNode extends RubyObject
    {
      protected static final String TEXT_WRAPPER_NAME = "nokogiri_text_wrapper";
    
    
    Severity: Major
    Found in ext/java/nokogiri/XmlNode.java - About 2 days to fix

      Method nextNode has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
      Open

        protected boolean
        nextNode()
        {
          // Non-recursive one-fetch-at-a-time depth-first traversal with
          // attribute/namespace nodes and white-space stripping.
      Severity: Minor
      Found in ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java - About 1 day to fix

      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 DOM2DTM.java has 782 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Licensed to the Apache Software Foundation (ASF) under one
       * or more contributor license agreements. See the NOTICE file
       * distributed with this work for additional information
       * regarding copyright ownership. The ASF licenses this file
      Severity: Major
      Found in ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java - About 1 day to fix

        File SaveContextVisitor.java has 757 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package nokogiri.internals;
        
        import static nokogiri.internals.NokogiriHelpers.canonicalizeWhitespace;
        import static nokogiri.internals.NokogiriHelpers.encodeJavaString;
        import static nokogiri.internals.NokogiriHelpers.isNamespace;
        Severity: Major
        Found in ext/java/nokogiri/internals/SaveContextVisitor.java - About 1 day to fix

          File extconf.rb has 722 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ENV["RC_ARCHS"] = "" if RUBY_PLATFORM =~ /darwin/
          
          require "mkmf"
          require "rbconfig"
          require "fileutils"
          Severity: Major
          Found in ext/nokogiri/extconf.rb - About 1 day to fix

            File NokogiriHelpers.java has 660 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package nokogiri.internals;
            
            import java.io.ByteArrayInputStream;
            import java.io.File;
            import java.lang.reflect.InvocationTargetException;
            Severity: Major
            Found in ext/java/nokogiri/internals/NokogiriHelpers.java - About 1 day to fix

              Class Node has 75 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class Node
                    include Nokogiri::XML::PP::Node
                    include Nokogiri::XML::Searchable
                    include Enumerable
              
              
              Severity: Major
              Found in lib/nokogiri/xml/node.rb - About 1 day to fix

                File element_description_defaults.rb has 596 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Nokogiri
                  module HTML4
                    class ElementDescription
                
                      # Methods are defined protected by method_defined? because at
                Severity: Major
                Found in lib/nokogiri/html4/element_description_defaults.rb - About 1 day to fix

                  Method handleAttributes has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                  Open

                    @Override
                    protected Iterator<Attr>
                    handleAttributes(Element element, NameSpaceSymbTable ns)
                    throws CanonicalizationException
                    {
                  Severity: Minor
                  Found in ext/java/nokogiri/internals/c14n/Canonicalizer11.java - About 1 day to fix

                  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 XmlDocument.java has 571 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  package nokogiri;
                  
                  import static nokogiri.internals.NokogiriHelpers.clearXpathContext;
                  import static nokogiri.internals.NokogiriHelpers.getCachedNodeOrCreate;
                  import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
                  Severity: Major
                  Found in ext/java/nokogiri/XmlDocument.java - About 1 day to fix

                    Method handleAttributes has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                    Open

                      @Override
                      protected final Iterator<Attr>
                      handleAttributes(Element element, NameSpaceSymbTable ns)
                      throws CanonicalizationException
                      {
                    Severity: Minor
                    Found in ext/java/nokogiri/internals/c14n/Canonicalizer20010315Excl.java - About 1 day to fix

                    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 removeDotSegments has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                    Open

                      private static String
                      removeDotSegments(String path)
                      {
                    
                        // 1. The input buffer is initialized with the now-appended path
                    Severity: Minor
                    Found in ext/java/nokogiri/internals/c14n/Canonicalizer11.java - About 1 day to fix

                    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 NokogiriService.java has 555 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    package nokogiri;
                    
                    import java.util.Collections;
                    import java.util.HashMap;
                    import java.util.Map;
                    Severity: Major
                    Found in ext/java/nokogiri/NokogiriService.java - About 1 day to fix

                      File XmlReader.java has 502 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      package nokogiri;
                      
                      import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
                      import static nokogiri.internals.NokogiriHelpers.stringOrBlank;
                      
                      
                      Severity: Major
                      Found in ext/java/nokogiri/XmlReader.java - About 1 day to fix

                        Method handleAttributes has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                        Open

                          @Override
                          protected Iterator<Attr>
                          handleAttributes(Element element, NameSpaceSymbTable ns)
                          throws CanonicalizationException
                          {
                        Severity: Minor
                        Found in ext/java/nokogiri/internals/c14n/Canonicalizer20010315.java - About 7 hrs to fix

                        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 node.rb has 481 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require "stringio"
                        
                        module Nokogiri
                          module XML
                            ##
                        Severity: Minor
                        Found in lib/nokogiri/xml/node.rb - About 7 hrs to fix

                          File ReaderNode.java has 480 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          package nokogiri.internals;
                          
                          import java.util.ArrayList;
                          import java.util.HashMap;
                          import java.util.List;
                          Severity: Minor
                          Found in ext/java/nokogiri/internals/ReaderNode.java - About 7 hrs to fix

                            File Canonicalizer11.java has 477 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /**
                             * Licensed to the Apache Software Foundation (ASF) under one
                             * or more contributor license agreements. See the NOTICE file
                             * distributed with this work for additional information
                             * regarding copyright ownership. The ASF licenses this file
                            Severity: Minor
                            Found in ext/java/nokogiri/internals/c14n/Canonicalizer11.java - About 7 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language