weexteam/weex_devtools_android

View on GitHub

Showing 2,519 of 2,519 total issues

Function 0 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

/***/ function(module, exports, __webpack_require__) {

    ;__weex_define__("@weex-component/918304b35162c0fa434158149beb7c82", [], function(__weex_require__, __weex_exports__, __weex_module__){
    __webpack_require__(18);

Severity: Minor
Found in playground/app/src/main/assets/showcase/new-fashion/category.js - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

      if (!TextUtils.isEmpty(url)) {
        Object requestBuilder = mRequestBuilderClazz.newInstance();
        Method urlMethod = ReflectionUtil.tryGetMethod(
            mRequestBuilderClazz,
            "url",
inspector/src/main/java/com/taobao/weex/devtools/debug/OkHttp3SocketClient.java on lines 109..142

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

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 (!TextUtils.isEmpty(url)) {
        Object requestBuilder = mRequestBuilderClazz.newInstance();
        Method urlMethod = ReflectionUtil.tryGetMethod(
            mRequestBuilderClazz,
            "url",
inspector/src/main/java/com/taobao/weex/devtools/debug/OkHttpSocketClient.java on lines 98..133

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

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

    public void start() {
        synchronized (DebugServerProxy.class) {
            if (mContext == null) {
                new IllegalArgumentException("Context is null").printStackTrace();
                return;

    Function data has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            data: function () {return {
              refresh_display: 'hide',
              loading_display: 'hide',
              sections: [
                {
    Severity: Major
    Found in playground/app/src/main/assets/component/scroller-demo.js - About 2 hrs to fix

      File AndroidDocumentProvider.java has 283 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 testAherf has 65 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");

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

          Method testAherf has a Cognitive Complexity of 19 (exceeds 5 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");

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

            @Override
            public AsyncPrettyPrinter getInstance(final String headerName, final String headerValue) {
          
              final MatchResult result = matchAndParseHeader(headerName, headerValue);
              if (result == 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

          Function 0 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          /***/ function(module, exports, __webpack_require__) {
          
              ;__weex_define__("@weex-component/41333d527ccae7db33e37491c3583a26", [], function(__weex_require__, __weex_exports__, __weex_module__){
              __webpack_require__(18);
          
          
          Severity: Minor
          Found in playground/app/src/main/assets/showcase/new-fashion/scene.js - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          File ObjectMapper.java has 274 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

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

                public void setUp() throws Exception{
            
                    Log.e("TestScript_Guide", "setUp  test!!");
                    setActivityInitialTouchMode(false);
                    weappApplication = new WeappJsBaseTestCase();
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleColumn.java on lines 43..66
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleRow.java on lines 43..66
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextType.java on lines 41..64

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

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

                public void setUp() throws Exception{
            
                    Log.e("TestScript_Guide", "setUp  test!!");
                    setActivityInitialTouchMode(false);
                    weappApplication = new WeappJsBaseTestCase();
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleColumn.java on lines 43..66
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleOwn.java on lines 41..65
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextType.java on lines 41..64

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

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

                public void setUp() throws Exception{
            
                    Log.e("TestScript_Guide", "setUp  test!!");
                    setActivityInitialTouchMode(false);
                    weappApplication = new WeappJsBaseTestCase();
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleColumn.java on lines 43..66
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleOwn.java on lines 41..65
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleRow.java on lines 43..66

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

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

                public void setUp() throws Exception{
            
                    Log.e("TestScript_Guide", "setUp  test!!");
                    setActivityInitialTouchMode(false);
                    weappApplication = new WeappJsBaseTestCase();
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleOwn.java on lines 41..65
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextStyleRow.java on lines 43..66
            playground/app/src/androidTest/java/com/alibaba/weex/uitest/TC_Text/WeexUiTestCaseTcTextType.java on lines 41..64

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

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

                public void testTextStyleColumn(){
            
                    for(final View caseView : mCaseListIndexView){
                        String caseViewText = new String("");
                        caseViewText = ((WXTextView)caseView).getText().toString();
              Severity
              Category
              Status
              Source
              Language