Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-5224

Deprecate the "accessors" metric

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0
    • Component/s: Measures
    • Labels:
      None

      Description

      In the past we introduced this "accessors" metric for the following bad reasons :

      • To not impact too much the average complexity metrics per function/class and file by excluding accessors from complexity computation
      • To not make LCOM4 metric too much useless by excluding accessors from LCOM4 computation. We've dropped support of LCOM4 so we can forget this last point.
      • To not consider "accessors" as being part of the API

      Why was it a bad decision to introduce this "accessors" metrics ?

      • Because from a theoretical point of view an "accessor" is definitely a "method/function" and must increment the complexity
      • Because nothing prevent a user from injecting a lot of logic in accessors. What should be done in that case ? Is it still an accessor? should we take into account this complexity ?
      • Because from a practical point of view, defining what is or not an accessor is a no-end task (SONARJAVA-8, SONARJAVA-7)
      • Because we have the same troubles for all language plugins

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              freddy.mallet Freddy Mallet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: