weexteam/weex_devtools_android

View on GitHub

Showing 472 of 2,519 total issues

Function _loadData has 153 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          _loadData: function () {
            var self = this;
            var content = [{
              "id": "1111",
              "sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1392&scm=1003.1.03653.SUB_1111_740603&pos=1",
Severity: Major
Found in playground/app/src/main/assets/showcase/new-fashion/main.js - About 6 hrs to fix

    Function 0 has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    /***/ function(module, exports, __webpack_require__) {
    
        ;__weex_define__("@weex-component/453b2fdb10f58e5716098d6f050875fc", [], function(__weex_require__, __weex_exports__, __weex_module__){
        __webpack_require__(20);
        __webpack_require__(19);
    Severity: Major
    Found in playground/app/src/main/assets/showcase/new-fashion/headlines.js - About 5 hrs to fix

      Function _initUtil has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                _initUtil: function () {
                    var self = this;
                    var app = self._app || {};
                    app.Util = {
                        randomInt: function (min, max) {
      Severity: Major
      Found in playground/app/src/main/assets/showcase/new-fashion/main.js - About 5 hrs to fix

        File WxDebug.java has 396 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package com.taobao.weex.devtools.inspector.protocol.module;
        
        import android.content.Context;
        import android.content.Intent;
        import android.util.Log;

          File scene.js has 393 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/scene.js - About 5 hrs to fix

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

                    data: function () {return {
                      eventCnt: 0,
                      togglePlayMsg: 'pause',
                      sliders: [
                        {
            Severity: Major
            Found in playground/app/src/main/assets/component/slider/index.js - About 5 hrs to fix

              Document has 39 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public final class Document extends ThreadBoundProxy {
                private final DocumentProviderFactory mFactory;
                private final ObjectIdMapper mObjectIdMapper;
                private final Queue<Object> mCachedUpdateQueue;
              
              

                Function httpurl has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                  httpurl: function (url) {
                                      var params = {};
                
                                      Object.defineProperty(this, 'params', {
                                          set: function (v) {
                Severity: Major
                Found in playground/app/src/main/assets/showcase/new-fashion/main.js - About 5 hrs to fix

                  Method getBoxModel has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    @ChromeDevtoolsMethod
                    public GetBoxModelResponse getBoxModel(JsonRpcPeer peer, JSONObject params) {
                      GetBoxModelResponse response = new GetBoxModelResponse();
                      final BoxModel model = new BoxModel();
                      final GetBoxModelRequest request = mObjectMapper.convertValue(

                    File ViewDescriptor.java has 374 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

                      Function 0 has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

                          @Nullable
                          public HealthReport traverse() {
                            long start = System.currentTimeMillis();
                            if (Looper.getMainLooper() == Looper.myLooper()) {
                              WXLogUtils.e(TAG, "illegal thread...");

                          Function ready has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  ready: function() {
                                    var stream = __weex_require__('@weex-module/stream');
                                    var me = this;
                                    var GET_URL_JSONP = 'http://jsfiddle.net/echo/jsonp/?callback=anything&result=content_in_response';
                                    var GET_URL = 'http://httpbin.org/get';
                          Severity: Major
                          Found in playground/app/src/main/assets/module/stream-demo.js - About 4 hrs to fix

                            File WeexUiTestCaseTcImageUpdate.java has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            package com.alibaba.weex.uitest.TC_Image;
                            
                            import android.app.Activity;
                            import android.app.Application;
                            import android.app.Instrumentation;

                              Method getValueForField has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                              Open

                                private Object getValueForField(Field field, Object value)
                                    throws JSONException {
                                  try {
                                    if (value != null) {
                                      if (value == JSONObject.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 loadAppSettings has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                              Open

                                private static void loadAppSettings(Context context) {
                                  int id = context.getResources().getIdentifier("app_config", "xml", context.getClass().getPackage().getName());
                                  if (id == 0) {
                                    // If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
                                    id = context.getResources().getIdentifier("app_config", "xml", context.getPackageName());

                              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

                              FastXmlSerializer has 33 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              public class FastXmlSerializer implements XmlSerializer {
                                private static final String ESCAPE_TABLE[] = new String[] {
                                    null,     null,     null,     null,     null,     null,     null,     null,  // 0-7
                                    null,     null,     null,     null,     null,     null,     null,     null,  // 8-15
                                    null,     null,     null,     null,     null,     null,     null,     null,  // 16-23

                                Method setElementChildren has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public void setElementChildren(Object element, List<Object> children) {
                                      // If we receive redundant information, then nothing needs to be done.
                                      ElementInfo changesElementInfo = mElementToInfoChangesMap.get(element);
                                      if (changesElementInfo != null &&
                                          ListUtil.identityEquals(children, changesElementInfo.children)) {

                                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

                                NetworkEventReporterImpl has 32 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                public class NetworkEventReporterImpl implements NetworkEventReporter {
                                  private final AtomicInteger mNextRequestId = new AtomicInteger(0);
                                  @Nullable
                                  private ResourceTypeHelper mResourceTypeHelper;
                                
                                
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language