weexteam/weex_devtools_android

View on GitHub
inspector/src/main/java/com/taobao/weex/devtools/adapter/WXTracingAdapter.java

Summary

Maintainability
C
1 day
Test Coverage

Method submitTracingEvent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public void submitTracingEvent(WXTracing.TraceEvent event) {

    int instanceId = Integer.parseInt(event.iid);
    if (instanceId == -1) {

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

  private void collectNativeTracingData(WXTracing.TraceEvent head, JSONArray out) {
    if (head.subEvents != null) {
      for (int i = 0; i < head.subEvents.size(); i++) {
        WXTracing.TraceEvent subEvent = head.subEvents.valueAt(i);
        if (subEvent.isSegment) {

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 submitTracingEvent has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @Override
  public void submitTracingEvent(WXTracing.TraceEvent event) {

    int instanceId = Integer.parseInt(event.iid);
    if (instanceId == -1) {

    Method sendSummaryInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private void sendSummaryInfo(String instanceId) {
        WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
        if (instance != null) {
          WXPerformance performance = instance.getWXPerformance();
          try {

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

        private void sendSummaryInfo(String instanceId) {
          WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
          if (instance != null) {
            WXPerformance performance = instance.getWXPerformance();
            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

      There are no issues that match your filters.

      Category
      Status