weexteam/weex_devtools_android

View on GitHub

Showing 472 of 2,519 total issues

Function created has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        created: function() {
          var bundleUrl = this.$getConfig().bundleUrl;
          console.log('hit', bundleUrl);
          var dirs = this.root.split('/');
          dirs.forEach(function(dir, index) {
Severity: Minor
Found in playground/app/src/main/assets/syntax/index.js - About 1 hr to fix

    Method testDowngrade has 36 lines of code (exceeds 25 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");

      Method testDowngrade has 36 lines of code (exceeds 25 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");

        Method testDowngrade has 36 lines of code (exceeds 25 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");

          Method testDowngrade has 36 lines of code (exceeds 25 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");

            Method testTextType has 36 lines of code (exceeds 25 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");

              Method testDowngrade has 36 lines of code (exceeds 25 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");

                Method testDowngrade has 36 lines of code (exceeds 25 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");

                  Method testDowngrade has 36 lines of code (exceeds 25 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");

                    Method Slider has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public  void Slider(){
                    
                            for(final View caseView : mCaseListIndexView){
                                if (((WXTextView)caseView).getText().toString().equals("TC_Slider")){
                                    Log.e(TAG, "TC_Slider find");

                      Method responseHeadersReceived has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        @Override
                        public void responseHeadersReceived(InspectorResponse response) {
                          NetworkPeerManager peerManager = getPeerManagerIfEnabled();
                          if (peerManager != null) {
                            Network.Response responseJSON = new Network.Response();

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

                                data: function () {return {
                                  appearMin:1,
                                  appearMax:1,
                                  appearIds:[],
                                  rows:[
                        Severity: Minor
                        Found in playground/app/src/main/assets/component/list/list-basic.js - About 1 hr to fix

                          Method intercept has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @Override
                              public Response intercept(Chain chain) throws IOException {
                                  String requestId = String.valueOf(mNextRequestId.getAndIncrement());
                          
                                  Request request = chain.request();

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

                              @Override
                              public Response intercept(Chain chain) throws IOException {
                                  String requestId = String.valueOf(mNextRequestId.getAndIncrement());
                          
                                  Request request = chain.request();

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

                            protected static Map<String, String> parseSetAttributesAsTextArg(String text) {
                              String value = "";
                              String key = "";
                              StringBuilder buffer = new StringBuilder();
                              Map<String, String> keyValuePairs = new HashMap<>();

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

                            @Override
                            protected void onGetChildren(AndroidDocumentRoot element, Accumulator<Object> children) {
                              if (DOM.isNativeMode()) {
                                children.store(mApplication);
                              } else {

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

                            private static String mapFlagsToStringUsingAnnotation(
                                int value,
                                @Nullable ViewDebug.ExportedProperty annotation) {
                              if (!canFlagsBeMappedToString(annotation)) {
                                throw new IllegalStateException("Cannot map using this annotation");

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

                            private static void updateListenerChildren(
                                ChildEventingList listenerChildren,
                                List<Object> newChildren,
                                Accumulator<Object> insertedElements) {
                              int index = 0;

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

                            @ChromeDevtoolsMethod
                            public JsonRpcResult emulateTouchFromMouseEvent(JsonRpcPeer peer, JSONObject params) {
                              final EmulateTouchFromMouseEventRequest request = mObjectMapper.convertValue(
                                  params, EmulateTouchFromMouseEventRequest.class);
                              try {

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

                              public RemoteObject objectForRemote(Object value) {
                                RemoteObject result = new RemoteObject();
                                if (value == null) {
                                  result.type = ObjectType.OBJECT;
                                  result.subtype = ObjectSubType.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

                          Severity
                          Category
                          Status
                          Source
                          Language