sparklemotion/nokogiri

View on GitHub

Showing 400 of 533 total issues

NokogiriHelpers has 51 methods (exceeds 20 allowed). Consider refactoring.
Open

public class NokogiriHelpers
{
  public static final String CACHED_NODE = "NOKOGIRI_CACHED_NODE";
  public static final String ROOT_NODE_INVALID = "NOKOGIRI_ROOT_NODE_INVALID";
  public static final String ENCODED_STRING = "NOKOGIRI_ENCODED_STRING";
Severity: Major
Found in ext/java/nokogiri/internals/NokogiriHelpers.java - About 7 hrs to fix

    File CanonicalizerBase.java has 453 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/CanonicalizerBase.java - About 6 hrs to fix

      SaveContextVisitor has 48 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class SaveContextVisitor
      {
      
        private final StringBuilder buffer;
        private final Stack<String> indentation;
      Severity: Minor
      Found in ext/java/nokogiri/internals/SaveContextVisitor.java - About 6 hrs to fix

        DOM2DTMdefaultNamespaceDeclarationNode has 48 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class DOM2DTMdefaultNamespaceDeclarationNode implements Attr, TypeInfo
        {
          final String NOT_SUPPORTED_ERR = "Unsupported operation on pseudonode";
        
          Element pseudoparent;

          Method canonicalizeSubTree has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

            protected final void
            canonicalizeSubTree(
              Node currentNode, NameSpaceSymbTable ns, Node endnode, int documentLevel, CanonicalFilter filter
            ) throws CanonicalizationException, IOException
            {
          Severity: Minor
          Found in ext/java/nokogiri/internals/c14n/CanonicalizerBase.java - About 6 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

          Method process_recipe has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          def process_recipe(name, version, static_p, cross_p, cacheable_p = true)
            require "rubygems"
            gem("mini_portile2", REQUIRED_MINI_PORTILE_VERSION) # gemspec is not respected at install time
            require "mini_portile2"
            message("Using mini_portile version #{MiniPortile::VERSION}\n")
          Severity: Minor
          Found in ext/nokogiri/extconf.rb - About 6 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

          Method circumventBug2650internal has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

            @SuppressWarnings("fallthrough")
            private static void
            circumventBug2650internal(Node node)
            {
              Node parent = null;
          Severity: Minor
          Found in ext/java/nokogiri/internals/c14n/XMLUtils.java - About 6 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

          XmlDocument has 44 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @JRubyClass(name = "Nokogiri::XML::Document", parent = "Nokogiri::XML::Node")
          public class XmlDocument extends XmlNode
          {
            private static final long serialVersionUID = 1L;
          
          
          Severity: Minor
          Found in ext/java/nokogiri/XmlDocument.java - About 6 hrs to fix

            Method joinURI has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

              private static String
              joinURI(String baseURI, String relativeURI) throws URISyntaxException
              {
                String bscheme = null;
                String bauthority = null;
            Severity: Minor
            Found in ext/java/nokogiri/internals/c14n/Canonicalizer11.java - About 5 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

            Method getNodeCompletePath has 142 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Method getXmlnsAttr has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

                  void
                  getXmlnsAttr(Collection<Attr> col) throws CanonicalizationException
                  {
                    int size = levels.size() - 1;
                    if (cur == null) {
              Severity: Minor
              Found in ext/java/nokogiri/internals/c14n/Canonicalizer11.java - About 5 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

              Method to_hash has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

                  def to_hash
                    header_directory = File.expand_path(File.join(File.dirname(__FILE__), "../../../ext/nokogiri"))
              
                    {}.tap do |vi|
                      vi["warnings"] = []
              Severity: Minor
              Found in lib/nokogiri/version/info.rb - About 5 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

              NokogiriService has 40 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class NokogiriService implements BasicLibraryService
              {
                public boolean
                basicLoad(Ruby ruby)
                {
              Severity: Minor
              Found in ext/java/nokogiri/NokogiriService.java - About 5 hrs to fix

                File XmlNodeSet.java has 376 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package nokogiri;
                
                import static nokogiri.XmlNode.setDocumentAndDecorate;
                import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
                import static nokogiri.internals.NokogiriHelpers.nodeListToRubyArray;
                Severity: Minor
                Found in ext/java/nokogiri/XmlNodeSet.java - About 5 hrs to fix

                  DOM2DTM has 38 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class DOM2DTM extends DTMDefaultBaseIterators
                  {
                  //    static final boolean JJK_DEBUG=false;
                  //    static final boolean JJK_NEWCODE=true;
                  
                  
                  Severity: Minor
                  Found in ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java - About 5 hrs to fix

                    Method relink_namespace has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                      public void
                      relink_namespace(ThreadContext context)
                      {
                        if (!(node instanceof Element)) {
                          return;
                    Severity: Minor
                    Found in ext/java/nokogiri/XmlNode.java - About 4 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

                    XmlReader has 37 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    @JRubyClass(name = "Nokogiri::XML::Reader")
                    public class XmlReader extends RubyObject
                    {
                      private static final long serialVersionUID = 1L;
                    
                    
                    Severity: Minor
                    Found in ext/java/nokogiri/XmlReader.java - About 4 hrs to fix

                      File XmlDtd.java has 360 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      package nokogiri;
                      
                      import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
                      import static nokogiri.internals.NokogiriHelpers.nonEmptyStringOrNil;
                      import static nokogiri.internals.NokogiriHelpers.stringOrNil;
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlDtd.java - About 4 hrs to fix

                        Method protectAgainstWrappingAttack has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public static boolean
                          protectAgainstWrappingAttack(Node startNode, String value)
                          {
                            Node startParent = startNode.getParentNode();
                            Node processedNode;
                        Severity: Minor
                        Found in ext/java/nokogiri/internals/c14n/XMLUtils.java - About 4 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 XmlSchema.java has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        package nokogiri;
                        
                        import static nokogiri.internals.NokogiriHelpers.adjustSystemIdIfNecessary;
                        import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
                        
                        
                        Severity: Minor
                        Found in ext/java/nokogiri/XmlSchema.java - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language