Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16688

Duplications in different files shown only in one file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: dry-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.498
      Duplicate Code Scanner Plug-in 2.33
    • Similar Issues:

      Description

      If CPD reports same duplication in different files Jenkins shows this duplication only in one of this files. This behavior confuses our developers so much that they prefer not to use this, nevertheless great, plugin any longer.

      Please have a look at attachment.
      For file B.cpp "Summary" in B.jpg shows a total of 3 duplications but in "Details" there is only one. For users it is hard to find the two other duplications if the project consists of many source files.

      I assume this behavior has something to to with JENKINS-12738 and JENKINS-11376.
      Therefore I´m not sure if this issue is a "Bug" or an "Improvement"

      Is it possible to display same duplicates in report of all related files?
      Or at least have a check-box which toggles behavior introduced in version 2.31?

        Attachments

        1. A.cpp
          0.2 kB
        2. A.jpg
          A.jpg
          30 kB
        3. B.cpp
          0.2 kB
        4. B.jpg
          B.jpg
          29 kB
        5. cpd.xml
          0.8 kB
        6. dry1.png
          dry1.png
          21 kB

          Issue Links

            Activity

            Hide
            drulli Ulli Hafner added a comment -

            Are these two screenshots from the same build? These warnings seem not to be correlated?

            I think the following behavior makes sense:

            • the plug-in should count the number of warnings (regardless of the category) as the total number of duplicated blocks.
            • I.e. if we have one block in A3 and A12 and B3 duplicated, then the number of warnings is 1 for total, and 1 for file A and 1 for file B
            • This result should be shown in the Summary view
            • in the warnings details there should be one row for each duplication
            • I.e the "primary file and line" (as reported from CPD) is shown on the left, the duplications are shown on the right
            • If a duplication is in two files, then on the left only one file is shown

            Does that make sense? If not can you please explain in more detail what you would like to expect? Maybe you can attach a cpd XML file that I can use a staring point for a unit test.

            Show
            drulli Ulli Hafner added a comment - Are these two screenshots from the same build? These warnings seem not to be correlated? I think the following behavior makes sense: the plug-in should count the number of warnings (regardless of the category) as the total number of duplicated blocks. I.e. if we have one block in A3 and A12 and B3 duplicated, then the number of warnings is 1 for total, and 1 for file A and 1 for file B This result should be shown in the Summary view in the warnings details there should be one row for each duplication I.e the "primary file and line" (as reported from CPD) is shown on the left, the duplications are shown on the right If a duplication is in two files, then on the left only one file is shown Does that make sense? If not can you please explain in more detail what you would like to expect? Maybe you can attach a cpd XML file that I can use a staring point for a unit test.
            Hide
            hjhafner Hans-Juergen Hafner added a comment -

            I´ve checked it again, screen shots are form same build. I attached cpd.xml and main page of DRY results dry1.png

            Show
            hjhafner Hans-Juergen Hafner added a comment - I´ve checked it again, screen shots are form same build. I attached cpd.xml and main page of DRY results dry1.png
            Hide
            drulli Ulli Hafner added a comment -

            Which behavior would make sense? I'm really not sure about what information should be shown on which tab in that case...

            Show
            drulli Ulli Hafner added a comment - Which behavior would make sense? I'm really not sure about what information should be shown on which tab in that case...

              People

              • Assignee:
                drulli Ulli Hafner
                Reporter:
                hjhafner Hans-Juergen Hafner
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: