SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-978

Useless Code Tracker must not execute CPD by himself

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: USELESS-CODE-TRACKER-0.2
    • Fix Version/s: USELESS-CODE-TRACKER-0.5
    • Component/s: Useless Code Tracker
    • Labels:
      None
    • Environment:
      Sonar 2.5
    • Number of attachments :
      1

      Description

      I think there is a problem with Useless Code Tracker plugin - code to be reduced that come from duplicated lines is bigger than duplicated lines detected:
      I have a project that has 71.752 duplicated lines in 13.242 blocks, but Useless Code Tracker tells that there are 167.503 lines that can be reduced coming from duplicated blocks. Is that possible?

      Project has 141.326 lines of code (201.305 physical lines). I have attached the sonar widgets with the information.

        Issue Links

          Activity

          Hide
          Olivier Gaudin added a comment -

          This is actually a limitation of this plugin, due to the fact that we are not using Sonar core to get the duplication data but running cpd instead. If a line of code is involved in several different duplications, this line is going to be counted several times.

          I will change the type of this issue to improvement

          Show
          Olivier Gaudin added a comment - This is actually a limitation of this plugin, due to the fact that we are not using Sonar core to get the duplication data but running cpd instead. If a line of code is involved in several different duplications, this line is going to be counted several times. I will change the type of this issue to improvement
          Hide
          Evgeny Mandrikov added a comment -

          Might be we should increase priority of this ticket, because Sonar now provides two CPD engines for Java - PMD and Sonar (SONAR-1091), whereas Useless Code Tracker relies only on PMD. And we plan to use Sonar CPD for other languages (SONAR-3139). Moreover - this dependency makes some refactorings harder due to need to keep backward compatibility.

          Show
          Evgeny Mandrikov added a comment - Might be we should increase priority of this ticket, because Sonar now provides two CPD engines for Java - PMD and Sonar ( SONAR-1091 ), whereas Useless Code Tracker relies only on PMD. And we plan to use Sonar CPD for other languages ( SONAR-3139 ). Moreover - this dependency makes some refactorings harder due to need to keep backward compatibility.
          Hide
          Evgeny Mandrikov added a comment -

          In addition - seems that there is no real need to embed PMD into Useless Code Tracker, because it relies only on classes, which are provided by sonar-duplications. Similar to SONAR-3144 - this will allow to reduce size of plugin approximately by 1 Mb.

          Show
          Evgeny Mandrikov added a comment - In addition - seems that there is no real need to embed PMD into Useless Code Tracker, because it relies only on classes, which are provided by sonar-duplications. Similar to SONAR-3144 - this will allow to reduce size of plugin approximately by 1 Mb.

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Antonio Calero
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: