weexteam/weex_devtools_android

View on GitHub
appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java

Summary

Maintainability
F
2 wks
Test Coverage

File XmlUtils.java has 1018 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Major
Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 2 days to fix

    XmlUtils has 60 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class XmlUtils {
    
        public static void skipCurrentTag(XmlPullParser parser)
            throws XmlPullParserException, IOException {
            int outerDepth = parser.getDepth();

      Method readThisValueXml has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          private static final Object readThisValueXml(XmlPullParser parser, String[] name,
                                                       ReadMapCallback callback)  throws XmlPullParserException, java.io.IOException {
              final String valueName = parser.getAttributeValue(null, "name");
              final String tagName = parser.getName();
      
      

      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 writeValueXml has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          private static final void writeValueXml(Object v, String name, XmlSerializer out,
                                                  WriteMapCallback callback)  throws XmlPullParserException, java.io.IOException {
              String typeStr;
              if (v == null) {
                  out.startTag(null, "null");

      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 readThisValueXml has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static final Object readThisValueXml(XmlPullParser parser, String[] name,
                                                       ReadMapCallback callback)  throws XmlPullParserException, java.io.IOException {
              final String valueName = parser.getAttributeValue(null, "name");
              final String tagName = parser.getName();
      
      

        Method readThisStringArrayXml has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final String[] readThisStringArrayXml(XmlPullParser parser, String endTag,
                                                                String[] name) throws XmlPullParserException, java.io.IOException {
        
                int num;
                try {

        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 readThisDoubleArrayXml has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final double[] readThisDoubleArrayXml(XmlPullParser parser, String endTag,
                                                                String[] name) throws XmlPullParserException, java.io.IOException {
        
                int num;
                try {

        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 readThisBooleanArrayXml has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final boolean[] readThisBooleanArrayXml(XmlPullParser parser, String endTag,
                                                                  String[] name) throws XmlPullParserException, java.io.IOException {
        
                int num;
                try {

        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 readThisIntArrayXml has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final int[] readThisIntArrayXml(XmlPullParser parser,
                                                          String endTag, String[] name)
                throws XmlPullParserException, java.io.IOException {
        
                int num;

        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 readThisLongArrayXml has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final long[] readThisLongArrayXml(XmlPullParser parser,
                                                            String endTag, String[] name)
                throws XmlPullParserException, java.io.IOException {
        
                int num;

        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 writeValueXml has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static final void writeValueXml(Object v, String name, XmlSerializer out,
                                                    WriteMapCallback callback)  throws XmlPullParserException, java.io.IOException {
                String typeStr;
                if (v == null) {
                    out.startTag(null, "null");

          Method readThisIntArrayXml has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static final int[] readThisIntArrayXml(XmlPullParser parser,
                                                            String endTag, String[] name)
                  throws XmlPullParserException, java.io.IOException {
          
                  int num;

            Method readThisStringArrayXml has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static final String[] readThisStringArrayXml(XmlPullParser parser, String endTag,
                                                                    String[] name) throws XmlPullParserException, java.io.IOException {
            
                    int num;
                    try {

              Method readThisDoubleArrayXml has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static final double[] readThisDoubleArrayXml(XmlPullParser parser, String endTag,
                                                                      String[] name) throws XmlPullParserException, java.io.IOException {
              
                      int num;
                      try {

                Method readThisBooleanArrayXml has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static final boolean[] readThisBooleanArrayXml(XmlPullParser parser, String endTag,
                                                                          String[] name) throws XmlPullParserException, java.io.IOException {
                
                        int num;
                        try {

                  Method readThisLongArrayXml has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static final long[] readThisLongArrayXml(XmlPullParser parser,
                                                                      String endTag, String[] name)
                          throws XmlPullParserException, java.io.IOException {
                  
                          int num;

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

                        public static final int
                        convertValueToInt(CharSequence charSeq, int defaultValue)
                        {
                            if (null == charSeq)
                                return defaultValue;

                      Method convertValueToInt has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final int
                          convertValueToInt(CharSequence charSeq, int defaultValue)
                          {
                              if (null == charSeq)
                                  return defaultValue;

                      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 readThisPrimitiveValueXml has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static final Object readThisPrimitiveValueXml(XmlPullParser parser, String tagName)
                              throws XmlPullParserException, java.io.IOException
                          {
                              try {
                                  if (tagName.equals("int")) {
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 45 mins 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 nextElementWithin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static boolean nextElementWithin(XmlPullParser parser, int outerDepth)
                              throws IOException, XmlPullParserException {
                              for (;;) {
                                  int type = parser.next();
                                  if (type == XmlPullParser.END_DOCUMENT
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 45 mins 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 parseUnsignedIntAttribute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static int parseUnsignedIntAttribute(CharSequence charSeq) {
                              String  value = charSeq.toString();
                      
                              long    bits;
                              int     index = 0;
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 45 mins 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 readThisMapXml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final HashMap<String, ?> readThisMapXml(XmlPullParser parser, String endTag,
                                                                                String[] name, ReadMapCallback callback)
                              throws XmlPullParserException, java.io.IOException
                          {
                              HashMap<String, Object> map = new HashMap<String, Object>();
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 35 mins 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 readThisListXml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static final ArrayList readThisListXml(XmlPullParser parser, String endTag,
                                                                         String[] name, ReadMapCallback callback)
                              throws XmlPullParserException, java.io.IOException {
                              ArrayList list = new ArrayList();
                      
                      
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 35 mins 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 readThisSetXml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static final HashSet readThisSetXml(XmlPullParser parser, String endTag, String[] name,
                                                                      ReadMapCallback callback) throws XmlPullParserException, java.io.IOException {
                              HashSet set = new HashSet();
                      
                              int eventType = parser.getEventType();
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 35 mins 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

                      Avoid too many return statements within this method.
                      Open

                                  return;
                      Severity: Major
                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                            return res;
                        Severity: Major
                        Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return;
                          Severity: Major
                          Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return res;
                            Severity: Major
                            Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                      return value;
                              Severity: Major
                              Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return;
                                Severity: Major
                                Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return;
                                  Severity: Major
                                  Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return;
                                    Severity: Major
                                    Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return;
                                      Severity: Major
                                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return;
                                        Severity: Major
                                        Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return res;
                                          Severity: Major
                                          Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return;
                                            Severity: Major
                                            Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                              return Long.valueOf(parser.getAttributeValue(null, "value"));
                                              Severity: Major
                                              Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                return Integer.parseInt(parser.getAttributeValue(null, "value"));
                                                Severity: Major
                                                Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return res;
                                                  Severity: Major
                                                  Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                return;
                                                    Severity: Major
                                                    Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return res;
                                                      Severity: Major
                                                      Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return res;
                                                        Severity: Major
                                                        Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 30 mins to fix

                                                          Method convertValueToList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              public static final int
                                                              convertValueToList(CharSequence value, String[] options, int defaultValue)
                                                              {
                                                                  if (null != value) {
                                                                      for (int i = 0; i < options.length; i++) {
                                                          Severity: Minor
                                                          Found in appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java - About 25 mins 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

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

                                                              public static final int[] readThisIntArrayXml(XmlPullParser parser,
                                                                                                            String endTag, String[] name)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  int num;
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1047..1092
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1108..1152
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1228..1272

                                                          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 278.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final double[] readThisDoubleArrayXml(XmlPullParser parser, String endTag,
                                                                                                                  String[] name) throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  int num;
                                                                  try {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 978..1031
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1047..1092
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1228..1272

                                                          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 278.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final long[] readThisLongArrayXml(XmlPullParser parser,
                                                                                                              String endTag, String[] name)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  int num;
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 978..1031
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1108..1152
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1228..1272

                                                          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 278.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final boolean[] readThisBooleanArrayXml(XmlPullParser parser, String endTag,
                                                                                                                    String[] name) throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  int num;
                                                                  try {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 978..1031
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1047..1092
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1108..1152

                                                          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 278.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final void writeIntArrayXml(int[] val, String name,
                                                                                                        XmlSerializer out)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  if (val == null) {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 455..479
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 494..518
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 572..596

                                                          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 166.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final void writeDoubleArrayXml(double[] val, String name, XmlSerializer out)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  if (val == null) {
                                                                      out.startTag(null, "null");
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 415..440
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 455..479
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 572..596

                                                          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 166.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final void writeLongArrayXml(long[] val, String name, XmlSerializer out)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  if (val == null) {
                                                                      out.startTag(null, "null");
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 415..440
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 494..518
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 572..596

                                                          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 166.

                                                          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 4 locations. Consider refactoring.
                                                          Open

                                                              public static final void writeBooleanArrayXml(boolean[] val, String name, XmlSerializer out)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                          
                                                                  if (val == null) {
                                                                      out.startTag(null, "null");
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 415..440
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 455..479
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 494..518

                                                          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 166.

                                                          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

                                                              private static final HashSet readThisSetXml(XmlPullParser parser, String endTag, String[] name,
                                                                                                          ReadMapCallback callback) throws XmlPullParserException, java.io.IOException {
                                                                  HashSet set = new HashSet();
                                                          
                                                                  int eventType = parser.getEventType();
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 875..898

                                                          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 143.

                                                          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

                                                              private static final ArrayList readThisListXml(XmlPullParser parser, String endTag,
                                                                                                             String[] name, ReadMapCallback callback)
                                                                  throws XmlPullParserException, java.io.IOException {
                                                                  ArrayList list = new ArrayList();
                                                          
                                                          
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 940..962

                                                          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 143.

                                                          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

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

                                                                  if ('0' == nm.charAt(index)) {
                                                                      //  Quick check for a zero by itself
                                                                      if (index == (len - 1))
                                                                          return 0;
                                                          
                                                          
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 148..165

                                                          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 126.

                                                          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

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

                                                                  if ('0' == value.charAt(index)) {
                                                                      //  Quick check for zero by itself
                                                                      if (index == (len - 1))
                                                                          return 0;
                                                          
                                                          
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 108..127

                                                          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 126.

                                                          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 3 locations. Consider refactoring.
                                                          Open

                                                              public static long readLongAttribute(XmlPullParser in, String name) throws IOException {
                                                                  final String value = in.getAttributeValue(null, name);
                                                                  try {
                                                                      return Long.parseLong(value);
                                                                  } catch (NumberFormatException e) {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1495..1502
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1532..1539

                                                          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 57.

                                                          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 3 locations. Consider refactoring.
                                                          Open

                                                              public static int readIntAttribute(XmlPullParser in, String name) throws IOException {
                                                                  final String value = in.getAttributeValue(null, name);
                                                                  try {
                                                                      return Integer.parseInt(value);
                                                                  } catch (NumberFormatException e) {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1518..1525
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1532..1539

                                                          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 57.

                                                          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 3 locations. Consider refactoring.
                                                          Open

                                                              public static float readFloatAttribute(XmlPullParser in, String name) throws IOException {
                                                                  final String value = in.getAttributeValue(null, name);
                                                                  try {
                                                                      return Float.parseFloat(value);
                                                                  } catch (NumberFormatException e) {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1495..1502
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1518..1525

                                                          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 57.

                                                          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

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

                                                                  } else if (v instanceof String) {
                                                                      out.startTag(null, "string");
                                                                      if (name != null) {
                                                                          out.attribute(null, "name", name);
                                                                      }
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 691..702

                                                          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 56.

                                                          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

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

                                                                  } else if (v instanceof CharSequence) {
                                                                      // XXX This is to allow us to at least write something if
                                                                      // we encounter styled text...  but it means we will drop all
                                                                      // of the styling information. :(
                                                                      out.startTag(null, "string");
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 646..654

                                                          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 56.

                                                          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

                                                              public static long readLongAttribute(XmlPullParser in, String name, long defaultValue) {
                                                                  final String value = in.getAttributeValue(null, name);
                                                                  try {
                                                                      return Long.parseLong(value);
                                                                  } catch (NumberFormatException e) {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1486..1493

                                                          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 40.

                                                          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

                                                              public static int readIntAttribute(XmlPullParser in, String name, int defaultValue) {
                                                                  final String value = in.getAttributeValue(null, name);
                                                                  try {
                                                                      return Integer.parseInt(value);
                                                                  } catch (NumberFormatException e) {
                                                          appframework/src/main/java/com/alibaba/weex/commons/util/XmlUtils.java on lines 1509..1516

                                                          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 40.

                                                          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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status