SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-165

"Undocumented API" detects private attributes as public

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Component/s: Rules, Squid
    • Labels:
      None
    • Environment:
      Sonar 3.5.1, Maven 3.0.2, Ubuntu 11.10
    • Number of attachments :
      2

      Description

      Original mailing list subject : http://markmail.org/thread/xm3hjaafyspxns7v

      The "Undocumented API" rule detects private attributes as undocumented public API's when the class-level Javadoc is missing.

      Here is how to reproduce this behavior :

      1. Start Sonar and add the "Undocumented API" rule to the
      default quality profile
      2. Run "mvn sonar:sonar" on the attached project sample
      3. Open Sonar. In the dashboard view of the project in the "Comments" widget, click on the percentage of documented API. It says that there is one undocumented API, which is the class Person, because it has no class-level Javadoc.
      4. Go back to the dashboard view, and click on the major rules violations. There should be only the Undocumented API rule listed, and this rule says that there are 3 undocumented API's : the class itself, but also the "name" and "age" properties (see attached screenshot)

      Then do the following :

      1. Add a class-level Javadoc to the class Person
      2. Run "mvn sonar:sonar" again
      3. Open Sonar and check both the dashboard metrics and the rule violations.
      4. This time, both rules say that there is no undocumented API anymore, which seems correct to me. The "name" and "age" properties are no longer detected as undocumented API by the rule.

        Activity

        Hide
        Freddy Mallet added a comment -

        I do confirm the issue !

        Show
        Freddy Mallet added a comment - I do confirm the issue !
        Hide
        Evgeny Mandrikov added a comment -

        Fixed.

        Show
        Evgeny Mandrikov added a comment - Fixed.
        Hide
        Evgeny Mandrikov added a comment -

        Integration tests were updated.

        Show
        Evgeny Mandrikov added a comment - Integration tests were updated.
        Hide
        Freddy Mallet added a comment -

        Manually tested !

        Show
        Freddy Mallet added a comment - Manually tested !

          People

          • Assignee:
            Evgeny Mandrikov
            Reporter:
            Fabien Guillod
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: