weexteam/weex_devtools_android

View on GitHub

Showing 472 of 2,519 total issues

Avoid too many return statements within this method.
Open

        return "Infinity";
Severity: Major
Found in inspector/src/main/java/com/taobao/weex/devtools/json/ObjectMapper.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return group.getChildAt(0).getMeasuredHeight();

      Avoid too many return statements within this method.
      Open

              return bounceRecyclerView.getMeasuredHeight();

        Avoid too many return statements within this method.
        Open

                return getPropertiesForIterable((List) object, /* enumerate */ true);

          Avoid too many return statements within this method.
          Open

              return null;

            Avoid too many return statements within this method.
            Open

                    return null;

              Avoid too many return statements within this method.
              Open

                    return Integer.parseInt(newValue);

                Avoid too many return statements within this method.
                Open

                        return null;

                  Avoid too many return statements within this method.
                  Open

                          return getPropertiesForProtoContainer((ObjectProtoContainer) object);

                    Avoid too many return statements within this method.
                    Open

                          return Long.parseLong(newValue);

                      Method onReceive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          public void onReceive(Context context, Intent intent) {
                            if (IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH.equals(intent.getAction())) {
                              if (mRefreshListener != null) {
                                mRefreshListener.onRefresh();
                      Severity: Minor
                      Found in appframework/src/main/java/com/alibaba/weex/commons/AbsWeexActivity.java - About 25 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 testAherfStyle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void testAherfStyle(){
                      
                              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 testDowngrade has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void testDowngrade(){
                      
                              for(final View caseView : mCaseListIndexView){
                                 if (((WXTextView)caseView).getText().toString().equals("TC_Downgrade")){
                                     Log.e(TAG, "TC_Downgrade 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 testTextType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void testTextType(){
                      
                              for(final View caseView : mCaseListIndexView){
                                 if (((WXTextView)caseView).getText().toString().equals("TC_Text")){
                                     Log.e(TAG, "TC_Text 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 findField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static Field findField(String name, Class clazz) throws NoSuchFieldException {
                              Class currentClass = clazz;
                              while (currentClass != Object.class) {
                                  for (Field field : currentClass.getDeclaredFields()) {
                                      if (name.equals(field.getName())) {
                      Severity: Minor
                      Found in playground/app/src/androidTest/java/com/alibaba/weex/util/Falcon.java - About 25 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 getAllEditTextViews has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static ArrayList<View> getAllEditTextViews(View view) {
                              ArrayList<View> allchildren = new ArrayList<View>();
                              if (view instanceof ViewGroup) {
                                  ViewGroup vp = (ViewGroup) view;
                                  for (int i = 0; i < vp.getChildCount(); i++) {
                      Severity: Minor
                      Found in playground/app/src/androidTest/java/com/alibaba/weex/util/ViewUtil.java - About 25 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 testDowngrade has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void testDowngrade(){
                      
                              for(final View caseView : mCaseListIndexView){
                                 if (((WXTextView)caseView).getText().toString().equals("TC_Downgrade")){
                                     Log.e(TAG, "TC_Downgrade 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 convertHeaders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        public static ArrayList<Pair<String, String>> convertHeaders(Map<String, List<String>> map) {
                          ArrayList<Pair<String, String>> array = new ArrayList<Pair<String, String>>();
                          for (Map.Entry<String, List<String>> mapEntry : map.entrySet()) {
                            for (String mapEntryValue : mapEntry.getValue()) {
                              // HttpURLConnection puts a weird null entry in the header map that corresponds to

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

                          public static View findFirstScrollerByRootView(View  rootView){
                      
                              View firstScrollView = null;
                      
                              if(null != rootView){

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

                          public void testDowngrade(){
                      
                              for(final View caseView : mCaseListIndexView){
                                 if (((WXTextView)caseView).getText().toString().equals("TC_Downgrade")){
                                     Log.e(TAG, "TC_Downgrade 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

                      Severity
                      Category
                      Status
                      Source
                      Language