sparklemotion/nokogiri

View on GitHub

Showing 628 of 628 total issues

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

/**
 * (The MIT License)
 *
 * Copyright (c) 2008 - 2014:
 *
Severity: Major
Found in ext/java/nokogiri/XmlNode.java - About 3 days to fix

    File test_node.rb has 1120 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "helper"
    
    require 'stringio'
    
    module Nokogiri
    Severity: Major
    Found in test/xml/test_node.rb - About 2 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;
      
              // TODO: Rename buffer to path.
      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

      Class TestNode has 139 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class TestNode < Nokogiri::TestCase
            def setup
              super
              @xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
            end
      Severity: Major
      Found in test/xml/test_node.rb - About 2 days to fix

        XmlNode has 107 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";
        
            /** The underlying Node object. */
        Severity: Major
        Found in ext/java/nokogiri/XmlNode.java - About 2 days to fix

          Class TestDocument has 107 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class TestDocument < Nokogiri::TestCase
                URI = if URI.const_defined?(:DEFAULT_PARSER)
                        ::URI::DEFAULT_PARSER
                      else
                        ::URI
          Severity: Major
          Found in test/xml/test_document.rb - About 2 days to fix

            File test_document.rb has 824 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "helper"
            
            require 'uri'
            
            module Nokogiri
            Severity: Major
            Found in test/xml/test_document.rb - About 1 day to fix

              Method nextNode has a Cognitive Complexity of 98 (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.
                      // Navigating the DOM is simple, navigating the DTM is simple;
              Severity: Minor
              Found in ext/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMExt.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 DOM2DTMExt.java has 816 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/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMExt.java - About 1 day to fix

                Class TestNodeSet has 89 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class TestNodeSet < Nokogiri::TestCase
                      class TestNodeSetNamespaces < Nokogiri::TestCase
                        def setup
                          super
                          @xml = Nokogiri.XML('<foo xmlns:n0="http://example.com" />')
                Severity: Major
                Found in test/xml/test_node_set.rb - About 1 day to fix

                  File test_node_set.rb has 667 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "helper"
                  
                  module Nokogiri
                    module XML
                      class TestNodeSet < Nokogiri::TestCase
                  Severity: Major
                  Found in test/xml/test_node_set.rb - About 1 day to fix

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

                    /**
                     * (The MIT License)
                     *
                     * Copyright (c) 2008 - 2012:
                     *
                    Severity: Major
                    Found in ext/java/nokogiri/internals/SaveContextVisitor.java - About 1 day to fix

                      File test_document.rb has 606 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require "helper"
                      
                      module Nokogiri
                        module HTML
                          class TestDocument < Nokogiri::TestCase
                      Severity: Major
                      Found in test/html/test_document.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 HTML
                            class ElementDescription
                        
                              # Methods are defined protected by method_defined? because at
                        Severity: Major
                        Found in lib/nokogiri/html/element_description_defaults.rb - About 1 day to fix

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

                          /**
                           * (The MIT License)
                           *
                           * Copyright (c) 2008 - 2014:
                           *
                          Severity: Major
                          Found in ext/java/nokogiri/internals/NokogiriHelpers.java - About 1 day to fix

                            Class Node has 68 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

                              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 {
                                      // result will contain the attrs which have to be output
                                      xmlattrStack.push(ns.getLevel());
                              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

                              Class TestDocument has 65 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  class TestDocument < Nokogiri::TestCase
                                    def setup
                                      super
                                      @html = Nokogiri::HTML.parse(File.read(HTML_FILE))
                                    end
                              Severity: Major
                              Found in test/html/test_document.rb - 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 {
                                        // result will contain the attrs which have to be output
                                        final SortedSet<Attr> result = this.result;
                                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
                                        // components then replace occurrences of "//" in the input buffer
                                        // with "/" until no more occurrences of "//" are in the input buffer.
                                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

                                Severity
                                Category
                                Status
                                Source
                                Language