SonarQube JavaScript
  1. SonarQube JavaScript
  2. SONARJS-29

Problem in the calculation of cyclomatic complexity

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.4
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      linux
    • Number of attachments :
      2

      Description

      the calculation of cyclomatic complexity is not accurate. in the attachment, you get the code and the screenshot.

      It appears to me that the number of methods is not accurate, and so does the calculation of complexity/method

      1. code.txt
        6 kB
        pti
      1. screenshot.JPG
        68 kB

        Issue Links

          Activity

          Hide
          Eriks Nukis added a comment -

          Metric "Complexity/Method" seems to be correct, but metric "Methods" was saved incorrectly. Will be fixed in 0.5

          Show
          Eriks Nukis added a comment - Metric "Complexity/Method" seems to be correct, but metric "Methods" was saved incorrectly. Will be fixed in 0.5
          Hide
          Eriks Nukis added a comment -

          Fixed in r5219

          Show
          Eriks Nukis added a comment - Fixed in r5219
          Hide
          pti added a comment -

          can be a dumb question... could you please tell me how to get the patch for this issue?
          should i wait for version 5, or can we get a patched version?

          Show
          pti added a comment - can be a dumb question... could you please tell me how to get the patch for this issue? should i wait for version 5, or can we get a patched version?
          Hide
          Eriks Nukis added a comment -
          Show
          Eriks Nukis added a comment - you can use snapshot version where this is already fixed http://snapshots.repository.codehaus.org/org/codehaus/sonar-plugins/sonar-javascript-plugin/0.5-SNAPSHOT/
          Hide
          Evgeny Mandrikov added a comment - - edited

          Note that this issue fully superseded by SONARPLUGINS-1789, because the way to compute number of functions and complexity was completely changed.

          For the given example:

          • functions = 7
          • complexity = 28
          Show
          Evgeny Mandrikov added a comment - - edited Note that this issue fully superseded by SONARPLUGINS-1789 , because the way to compute number of functions and complexity was completely changed. For the given example: functions = 7 complexity = 28

            People

            • Assignee:
              Unassigned
              Reporter:
              Anonymous
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: