weexteam/weex_devtools_android

View on GitHub

Showing 472 of 2,519 total issues

Function anim has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

                anim: function(ref, styles, timingFunction, duration, callback) {
Severity: Minor
Found in playground/app/src/main/assets/showcase/dropdown/we-dropdown.js - About 35 mins to fix

    Method callAddElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      public native void callAddElement(String instanceId, String ref, String dom, String index,
                                        String callback);

      Method interpretResponseStream has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public InputStream interpretResponseStream(String requestId, String contentType, String contentEncoding, InputStream stream, boolean continueRead) {

        Method interpretResponseStream has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                public InputStream interpretResponseStream(String requestId, @Nullable String contentType, @Nullable String contentEncoding, @Nullable InputStream inputStream, ResponseHandler responseHandler) {

          Method getFirstChildScrollableView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static View getFirstChildScrollableView(ViewGroup view){
          
          
                  View viewResult = null;
                  ArrayList<View> allViews = new ArrayList<View>();
          Severity: Minor
          Found in playground/app/src/androidTest/java/com/alibaba/weex/util/ViewUtil.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

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

            public void runWithPermissionsCheck(int requestCode, String permission, Runnable runnable) {
              if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {
                if (ActivityCompat.shouldShowRequestPermissionRationale(this, permission)) {
                  Toast.makeText(this, "please give me the permission", Toast.LENGTH_SHORT).show();
                } else {
          Severity: Minor
          Found in appframework/src/main/java/com/alibaba/weex/commons/AbsWeexActivity.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 endTag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            public XmlSerializer endTag(String namespace, String name) throws IOException,
                IllegalArgumentException, IllegalStateException {
              mNesting--;
              if (mInTag) {
                append(" />\n");

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

            private static void getDialogFragments(
                @Nullable FragmentCompat compat,
                Activity activity,
                Accumulator<Object> accumulator) {
              if (compat == null || !compat.getFragmentActivityClass().isInstance(activity)) {

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

            private int getRealDomMaxLayer(@NonNull View rootView) {
              int maxLayer = 0;
              Deque<LayeredNode<View>> deque = new ArrayDeque<>();
              LayeredNode<View> rootNode = mRealDomObjectPool.obtain();
              rootNode.set(rootView,null,START_LAYER_OF_REAL_DOM);
          Severity: Minor
          Found in inspector/src/main/java/com/taobao/weex/devtools/trace/DomTracker.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 doesElementMatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            private boolean doesElementMatch(Object element, int x, int y) {
              View view = null;
              if (DOM.isNativeMode()) {
                if (element instanceof View) {
                  view = (View)element;

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

            private String getUrl(Uri uri) {
              String url = uri.toString();
              String scheme = uri.getScheme();
              if (uri.isHierarchical()) {
                if (TextUtils.equals(scheme, "http") || TextUtils.equals(scheme, "https")) {
          Severity: Minor
          Found in playground/app/src/main/java/com/alibaba/weex/WXPageActivity.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 getElementForView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            private Object getElementForView(ViewGroup parentView, View childView) {
              Object value = mViewToElementMap.get(childView);
              if (value != null) {
                Object element = getElement(childView, value);
          
          

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

            @Override
            protected void onGetAttributes(WXComponent element, AttributeAccumulator attributes) {
              HashMap<String, String> map = getAttribute(element);
              if (map != null && map.size() > 0) {
                for (HashMap.Entry<String, String> entry : map.entrySet()) {

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

              public ArrayList<View> getTestCaseListViewByText(String byText) throws InterruptedException {
                  Log.e("TestScript_Guide", "byText ==" + byText);
          
                  if(TextUtils.isEmpty(byText)){
                      return 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 19 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          /***/ function(module, exports, __webpack_require__) {
          
              ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
              __webpack_require__(18);
          
          
          Severity: Minor
          Found in playground/app/src/main/assets/showcase/new-fashion/fashion.js - 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 getProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public GetPropertiesResponse getProperties(JSONObject params) throws JsonRpcException {
                GetPropertiesRequest request = mObjectMapper.convertValue(params, GetPropertiesRequest.class);
          
                if (!request.ownProperties) {
                  GetPropertiesResponse response = new GetPropertiesResponse();

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

          /***/ function(module, exports, __webpack_require__) {
          
              ;__weex_define__("@weex-component/banners", [], function(__weex_require__, __weex_exports__, __weex_module__){
              __webpack_require__(18);
          
          
          Severity: Minor
          Found in playground/app/src/main/assets/showcase/new-fashion/resource.js - 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

          Severity
          Category
          Status
          Source
          Language