sparklemotion/nokogiri

View on GitHub

Showing 400 of 537 total issues

Method enter has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public boolean
  enter(Node node)
  {
    if (node instanceof Document) {
      return enter((Document)node);
Severity: Minor
Found in ext/java/nokogiri/internals/SaveContextVisitor.java - About 1 hr to fix

    Method populateNokogiriClassCache has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private static Map<String, RubyClass>
      populateNokogiriClassCache(Ruby ruby)
      {
        Map<String, RubyClass> nokogiriClassCache = new HashMap<String, RubyClass>();
        nokogiriClassCache.put("Nokogiri::HTML4::Document", (RubyClass)ruby.getClassFromPath("Nokogiri::HTML4::Document"));
    Severity: Minor
    Found in ext/java/nokogiri/NokogiriService.java - About 1 hr to fix

      Method getAttrsAndNamespaces has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private Attr[]
        getAttrsAndNamespaces(Element element)
        {
          NamedNodeMap attrs = element.getAttributes();
          if (!canonical) {
      Severity: Minor
      Found in ext/java/nokogiri/internals/SaveContextVisitor.java - About 1 hr to fix

        Method protectAgainstWrappingAttack has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public static boolean
          protectAgainstWrappingAttack(
            Node startNode, Element knownElement, String value
          )
          {
        Severity: Minor
        Found in ext/java/nokogiri/internals/c14n/XMLUtils.java - About 1 hr to fix

          Method pretty_print has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def pretty_print(pp)
                    nice_name = self.class.name.split("::").last
                    pp.group(2, "#(#{nice_name}:#{format("0x%x", object_id)} {", "})") do
                      pp.breakable
          
          
          Severity: Minor
          Found in lib/nokogiri/xml/pp/node.rb - About 1 hr to fix

            Method handleParent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              @Override
              protected void
              handleParent(Element e, NameSpaceSymbTable ns)
              {
                if (!e.hasAttributes() && e.getNamespaceURI() == null) {
            Severity: Minor
            Found in ext/java/nokogiri/internals/c14n/Canonicalizer20010315.java - About 1 hr to fix

              Method serializeAttrTextContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private static CharSequence
                serializeAttrTextContent(String str, boolean htmlDoc)
                {
                  if (str == null || str.length() == 0) { return ""; }
              
              
              Severity: Minor
              Found in ext/java/nokogiri/internals/SaveContextVisitor.java - About 1 hr to fix

                Method handleParent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  @Override
                  protected void
                  handleParent(Element e, NameSpaceSymbTable ns)
                  {
                    if (!e.hasAttributes() && e.getNamespaceURI() == null) {
                Severity: Minor
                Found in ext/java/nokogiri/internals/c14n/Canonicalizer11.java - About 1 hr to fix

                  Method key_p has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    @JRubyMethod(name = {"key?", "has_attribute?"})
                    public IRubyObject
                    key_p(ThreadContext context, IRubyObject rbkey)
                    {
                      if (node instanceof Element) {
                  Severity: Minor
                  Found in ext/java/nokogiri/XmlNode.java - About 1 hr 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 setUrl has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public static void
                    setUrl(ThreadContext context, InputSource source, IRubyObject url)
                    {
                      String path = rubyStringToString(url);
                      // Dir.chdir might be called at some point before this.
                  Severity: Minor
                  Found in ext/java/nokogiri/internals/ParserContext.java - About 1 hr 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 getHandleFromNode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public int
                    getHandleFromNode(Node node)
                    {
                      if (null != node) {
                        int len = m_nodes.size();
                  Severity: Minor
                  Found in ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java - About 1 hr 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 getSchema has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    private Schema
                    getSchema(Source source, ThreadContext context)
                    {
                      InputStream is;
                      VerifierFactory factory = new com.thaiopensource.relaxng.jarv.VerifierFactoryImpl();
                  Severity: Minor
                  Found in ext/java/nokogiri/XmlRelaxng.java - About 1 hr 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 in_context has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    @JRubyMethod(required = 2, visibility = Visibility.PRIVATE)
                    public IRubyObject
                    in_context(ThreadContext context, IRubyObject str, IRubyObject options)
                    {
                      RubyClass klass;
                  Severity: Minor
                  Found in ext/java/nokogiri/XmlNode.java - About 1 hr 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 getStringValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public XMLString
                    getStringValue(int nodeHandle)
                    {
                  
                      int type = getNodeType(nodeHandle);
                  Severity: Minor
                  Found in ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java - About 1 hr 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 ancestors has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def ancestors(selector = nil)
                          return NodeSet.new(document) unless respond_to?(:parent)
                          return NodeSet.new(document) unless parent
                  
                          parents = [parent]
                  Severity: Minor
                  Found in lib/nokogiri/xml/node.rb - About 1 hr 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 extractDecls has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    protected void
                    extractDecls(ThreadContext context)
                    {
                      Ruby runtime = context.runtime;
                  
                  
                  Severity: Minor
                  Found in ext/java/nokogiri/XmlDtd.java - About 1 hr 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 extractDecls has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    protected void
                    extractDecls(ThreadContext context)
                    {
                      Ruby runtime = context.runtime;
                  
                  
                  Severity: Minor
                  Found in ext/java/nokogiri/XmlDtd.java - About 1 hr to fix

                    Method native_write has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      @JRubyMethod
                      public IRubyObject
                      native_write(ThreadContext context, IRubyObject chunk,
                                   IRubyObject isLast)
                      {
                    Severity: Minor
                    Found in ext/java/nokogiri/XmlSaxPushParser.java - About 1 hr to fix

                      Method writeCharToUtf8 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public static void
                        writeCharToUtf8(final char c, final OutputStream out) throws IOException
                        {
                          if (c < 0x80) {
                            out.write(c);
                      Severity: Minor
                      Found in ext/java/nokogiri/internals/c14n/UtfHelper.java - About 1 hr to fix

                        Method transform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          @JRubyMethod(rest = true, required = 1, optional = 2)
                          public IRubyObject
                          transform(ThreadContext context, IRubyObject[] args)
                          {
                            Ruby runtime = context.getRuntime();
                        Severity: Minor
                        Found in ext/java/nokogiri/XsltStylesheet.java - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language