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/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 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 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 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();

                      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");

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

                              @Override
                              public int execJS(String instanceId, String namespace, String function, WXJSObject[] args) {
                                  ArrayList<Object> array = new ArrayList<>();
                                  int argsCount = args == null ? 0 : args.length;
                                  for (int i = 0; i < argsCount; i++) {

                          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