sparklemotion/nokogiri

View on GitHub

Showing 529 of 529 total issues

File XmlNode.java has 1420 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 108 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @JRubyClass(name = "Nokogiri::XML::Node")
    public class XmlNode extends RubyObject
    {
      private static final long serialVersionUID = 1L;
    
    
    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 783 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 760 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 742 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ENV["RC_ARCHS"] = "" if RUBY_PLATFORM.include?("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 74 methods (exceeds 20 allowed). Consider refactoring.
              Open

              Severity: Major
              Found in lib/nokogiri/xml/node.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 535 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 520 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

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

                      module Nokogiri
                        module HTML4
                          class ElementDescription
                            # Methods are defined protected by method_defined? because at
                            # this point the C-library or Java library is already loaded,
                      Severity: Major
                      Found in lib/nokogiri/html4/element_description_defaults.rb - 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 ReaderNode.java has 481 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 node.rb has 479 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          Severity: Minor
                          Found in lib/nokogiri/xml/node.rb - 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