Duplication Exclusions using the UI do not match given pattern

15 views
Skip to first unread message

mrkri...@gmail.com

unread,
Jul 26, 2017, 2:07:31 AM7/26/17
to SonarQube

Hello,


I am trying to exclude some Java POJO's from the rule "common-java:DuplicatedBlocks". I have filled in my pattern as below:



Expectation
All files such as the following are excluded using the pattern below

src/**/*Form.java,src/**/*Dto.java,src/**/*DTO.java
  • src/foo/MyForm.java 
  • src/bar/MyDto.java
  • src/MyDTO.java
However, nothing is being excluded. What am I missing here? I am running SonarQube 5.6.6.

mrkri...@gmail.com

unread,
Jul 26, 2017, 2:14:58 AM7/26/17
to SonarQube, mrkri...@gmail.com
I should add that I have cloned the Github repo and ran DefaultCpdTokensTest.handle_exclusions_by_pattern() with the pattern mentioned above and some test files and was able to verify that the test still passed (i.e. no interactions, meaning that the file was correctly ignored).

G. Ann Campbell

unread,
Jul 26, 2017, 9:40:47 AM7/26/17
to SonarQube, mrkri...@gmail.com
Hi,

Thanks for including a screenshot! It shows that you're trying to add all your patterns in one, comma-delimited string. But that's what the "Add value" button is for. Have the UI add an input per pattern & let the back-end do the comma-delimiting!


Ann

mrkri...@gmail.com

unread,
Jul 27, 2017, 2:48:53 AM7/27/17
to SonarQube, mrkri...@gmail.com
Hello Ann,

Thank you! That did the trick, problem resolved. :-)
Reply all
Reply to author
Forward
0 new messages