sparklemotion/nokogiri

View on GitHub

Showing 537 of 537 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    for (int i = 0; i < nodes.length; i++) {
      if (nodes[i] instanceof XmlNode) {
        ((XmlNode) nodes[i]).unlink(context);
      }
    }
Severity: Minor
Found in ext/java/nokogiri/XmlNodeSet.java and 1 other location - About 40 mins to fix
ext/java/nokogiri/XmlNode.java on lines 502..506

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    for (int i = 0; i < nodes.length; i++) {
      if (nodes[i] instanceof XmlNode) {
        ((XmlNode) nodes[i]).relink_namespace(context);
      }
    }
Severity: Minor
Found in ext/java/nokogiri/XmlNode.java and 1 other location - About 40 mins to fix
ext/java/nokogiri/XmlNodeSet.java on lines 432..436

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  protected void
  setOccur(String type)
  {
    if ("*".equals(type)) { this.occur = Occur.MULT; }
    else if ("+".equals(type)) { this.occur = Occur.PLUS; }
Severity: Minor
Found in ext/java/nokogiri/XmlElementContent.java and 1 other location - About 40 mins to fix
ext/java/nokogiri/XmlElementContent.java on lines 229..234

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  protected void
  setType(String type)
  {
    if ("|".equals(type)) { this.type = Type.OR; }
    else if (",".equals(type)) { this.type = Type.SEQ; }
Severity: Minor
Found in ext/java/nokogiri/XmlElementContent.java and 1 other location - About 40 mins to fix
ext/java/nokogiri/XmlElementContent.java on lines 236..241

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        while (tmp != null) {
          if ((tmp.getNodeType() == Node.ELEMENT_NODE) &&
              (generic || fullNamesMatch(tmp, cur))) {
            occur++;
          }
Severity: Minor
Found in ext/java/nokogiri/internals/NokogiriHelpers.java and 1 other location - About 40 mins to fix
ext/java/nokogiri/internals/NokogiriHelpers.java on lines 339..345

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          while (tmp != null && occur == 0) {
            if ((tmp.getNodeType() == Node.ELEMENT_NODE) &&
                (generic || fullNamesMatch(tmp, cur))) {
              occur++;
            }
Severity: Minor
Found in ext/java/nokogiri/internals/NokogiriHelpers.java and 1 other location - About 40 mins to fix
ext/java/nokogiri/internals/NokogiriHelpers.java on lines 328..334

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method resolveResource has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    resolveResource(String type,
                    String namespaceURI,
                    String publicId,
                    String systemId,
                    String baseURI)
Severity: Minor
Found in ext/java/nokogiri/XmlSchema.java - About 35 mins to fix

    Method canonicalizeSubTree has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        Node currentNode, NameSpaceSymbTable ns, Node endnode, int documentLevel, CanonicalFilter filter
    Severity: Minor
    Found in ext/java/nokogiri/internals/c14n/CanonicalizerBase.java - About 35 mins to fix

      Method createTextNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        createTextNode(Ruby ruby, String content, int depth, Stack<String> langStack, Stack<String> xmlBaseStack)
      Severity: Minor
      Found in ext/java/nokogiri/internals/ReaderNode.java - About 35 mins to fix

        Method resolveEntity has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          resolveEntity(Ruby runtime, String name, String publicId, String baseURI, String systemId)
        Severity: Minor
        Found in ext/java/nokogiri/internals/NokogiriEntityResolver.java - About 35 mins to fix

          Method getSchema has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            getSchema(Source source,
                      String currentDir,
                      String scriptFileName,
                      SchemaErrorHandler errorHandler,
                      long parseOptions) throws SAXException
          Severity: Minor
          Found in ext/java/nokogiri/XmlSchema.java - About 35 mins to fix

            Method createImpl has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              createImpl(Node owner, IRubyObject prefix, String prefixStr, IRubyObject href, String hrefStr)
            Severity: Minor
            Found in ext/java/nokogiri/XmlNamespace.java - About 35 mins to fix

              Method newEmpty has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                newEmpty(Ruby runtime,
                         Document doc,
                         IRubyObject name,
                         IRubyObject external_id,
                         IRubyObject system_id)
              Severity: Minor
              Found in ext/java/nokogiri/XmlDtd.java - About 35 mins to fix

                Method xpath_internal has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      def xpath_internal(node, paths, handler, ns, binds)
                Severity: Minor
                Found in lib/nokogiri/xml/searchable.rb - About 35 mins to fix

                  Method start_element_namespace has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) # rubocop:disable Metrics/ParameterLists
                  Severity: Minor
                  Found in lib/nokogiri/xml/sax/document.rb - About 35 mins to fix

                    Method parse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def parse(string, url = nil, encoding = nil, **options, &block)
                    Severity: Minor
                    Found in lib/nokogiri/html5.rb - About 35 mins to fix

                      Method start_element_namespace has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) # rubocop:disable Metrics/ParameterLists
                      Severity: Minor
                      Found in lib/xsd/xmlparser/nokogiri.rb - About 35 mins to fix

                        Method HTML5 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def self.HTML5(input, url = nil, encoding = nil, **options, &block)
                        Severity: Minor
                        Found in lib/nokogiri/html5.rb - About 35 mins to fix

                          Method XML has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def XML(thing, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_XML, &block)
                          Severity: Minor
                          Found in lib/nokogiri/xml.rb - About 35 mins to fix

                            Method process_recipe has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def process_recipe(name, version, static_p, cross_p, cacheable_p = true)
                            Severity: Minor
                            Found in ext/nokogiri/extconf.rb - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language