weexteam/weex_devtools_android

View on GitHub
inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/AndroidDocumentProvider.java

Summary

Maintainability
B
5 hrs
Test Coverage

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

          @Override
          public boolean onTouchEvent(MotionEvent event) {
            if (getParent() instanceof View) {
              final View parent = (View)getParent();
              View view = ViewUtil.hitTest(parent, event.getX(), event.getY(), mViewSelector);

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

      private void getWindows(final Accumulator<Window> accumulator) {
        Descriptor appDescriptor = getDescriptor(mApplication);
        if (appDescriptor != null) {
          Accumulator<Object> elementAccumulator = new Accumulator<Object>() {
            @Override

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

      @Override
      public View getHighlightingView(Object element) {
        if (element == null) {
          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

    There are no issues that match your filters.

    Category
    Status