weexteam/weex_devtools_android

View on GitHub

Showing 2,519 of 2,519 total issues

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

    @Test
    public void testByTestMap() {
        for (final View caseView : mCaseListIndexView) {

            String caseViewName = ((WXTextView) caseView).getText().toString();

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

    public void testAherf(){

        for(final View caseView : mCaseListIndexView){
           if (((WXTextView)caseView).getText().toString().equals("TC_AHref")){
               Log.e(TAG, "TC_AHref find");

    File headlines.js has 301 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /******/ (function(modules) { // webpackBootstrap
    /******/     // The module cache
    /******/     var installedModules = {};
    
    /******/     // The require function
    Severity: Minor
    Found in playground/app/src/main/assets/showcase/new-fashion/headlines.js - About 3 hrs to fix

      File Network.java has 300 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * Copyright (c) 2014-present, Facebook, Inc.
       * All rights reserved.
       *
       * This source code is licensed under the BSD-style license found in the

        Method applyDocumentUpdate has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private void applyDocumentUpdate(final ShadowDocument.Update docUpdate) {
            // TODO: it'd be nice if we could delegate our calls into mPeerManager.sendNotificationToPeers()
            //       to a background thread so as to offload the UI from JSON serialization stuff
        
            // First, any elements that have been disconnected from the tree, and any elements in those

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Input_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

          package com.alibaba.weex.uitest.TC_AG;
          import com.alibaba.weex.WXPageActivity;
          import com.alibaba.weex.util.TestFlow;
          import java.util.HashMap;
          import org.junit.Before;
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_A_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Div_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Image_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Switch_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Text_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Video_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_CommonStyle_Web_Widthandheight.java on lines 1..51
          playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_AG/AG_Text_Text_Line_Height.java on lines 1..51

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

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

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

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

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

          Refactorings

          Further Reading

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

                @Test
                public void testByTestMap() {
                    for (final View caseView : mCaseListIndexView) {
            
                        String caseViewName = ((WXTextView) caseView).getText().toString();

              Method submitTracingEvent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                @Override
                public void submitTracingEvent(WXTracing.TraceEvent event) {
              
                  int instanceId = Integer.parseInt(event.iid);
                  if (instanceId == -1) {

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language