Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12508

Add code complexity to the Code Change Report

    • Storage Engines
    • 5
    • 2024-03-05 - Claronald

      This ticket is will add code complexity statistics to the Code Change Report.

      Specifically, it will add a list of functions added/changed (only within C/C++ code in the ‘src’ directory), sorted by module/filename, with the following info displayed

      • The (new) total number of lines of code in the function (a proxy for complexity)
        • Along with the old number of lines, and the delta
      • The cyclomatic complexity for that function after the change
        • Along with the old complexity and the delta
        • Complexity will be colour coded (eg green/amber/red/purple for how high this is)
          • Suggested colours (and using the SEI categories):
            • Green: <=10 (SEI: A simple module without much risk)
            • Amber: 11 to 20 (SEI: A more complex module with moderate risk)
            • Red: 21 to 50 (SEI: A complex module of high risk)
            • Purple: 51+ - (SEI: An untestable program of very high risk)
      • Branch code coverage for each changed function and the overall change
      • Uncovered complexity for each changed function
        • Where, uncovered complexity = cyclomatic complexity * (1 - branch code coverage fraction).
          • So, a function of complexity 50, with 40% code coverage, would have uncovered complexity of 30 (which would be considered high).
          • High uncovered complexity is an indication of higher risk

            Assignee:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Reporter:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: