sparklemotion/nokogiri

View on GitHub

Showing 514 of 514 total issues

File XmlNode.java has 1239 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

    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

    XmlNode has 106 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

      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/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 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/nokogiri/internals/dom2dtm/DOM2DTM.java - 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 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

            Class Node has 69 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 NokogiriHelpers.java has 587 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

                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

                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

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

                ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/
                
                require 'mkmf'
                
                ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
                Severity: Major
                Found in ext/nokogiri/extconf.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 {
                          // result will contain the attrs which have to be output
                          xmlattrStack.push(ns.getLevel());
                  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

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

                  public class NokogiriHelpers {
                      public static final String CACHED_NODE = "NOKOGIRI_CACHED_NODE";
                      public static final String VALID_ROOT_NODE = "NOKOGIRI_VALIDE_ROOT_NODE";
                      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 NokogiriService.java has 484 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                     * (The MIT License)
                     *
                     * Copyright (c) 2008 - 2011:
                     *
                    Severity: Minor
                    Found in ext/java/nokogiri/NokogiriService.java - About 7 hrs to fix

                      File XmlDocument.java has 476 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /**
                       * (The MIT License)
                       *
                       * Copyright (c) 2008 - 2014:
                       *
                      Severity: Minor
                      Found in ext/java/nokogiri/XmlDocument.java - About 7 hrs to fix

                        File Canonicalizer11.java has 452 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 6 hrs to fix

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

                          public class SaveContextVisitor {
                          
                              private final StringBuilder buffer;
                              private final Stack<String> indentation;
                              private String encoding;
                          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;
                              Severity
                              Category
                              Status
                              Source
                              Language