-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace deprecated cpd mapping #941
Conversation
@ALL maybe you can have a look if this is working for you? |
@guwirth not related with this pr, but the highligting feature is throwing a exception |
@jmecosta issue is in file/line: 12:30:53][Step 1/1] Caused by: java.lang.IllegalArgumentException: 104 is not a valid line offset for pointer. FileoduleKey=tekla.structures.core:Common, relative=libfilesystem/tool_sys_io_util.cpp, basedir=E:\prod\structures\src\work\Core\Common] has 60 character(s) at line 292 What is special in this line?
|
@guwirth just a comment.
|
@jmecosta strange this line is only 24 character long. Message is saying: 104 is not a valid line offset ... has 60 character(s) at line 292? |
sorry wrong file |
@jmecosta just another idea: insert the content of your file into https://github.com/SonarOpenCommunity/sonar-cxx/blob/fe897b6ca0eb0c5668a80d21260e7e77a8a3cb97/sonar-cxx-plugin/src/test/resources/org/sonar/plugins/cxx/highlighter.cc to reproduce the issue. |
* update pom to version 36 * add new cpd visitor * add a cpd sensor test * adapt integration tests: slightly different numbers new algorithm: ignoreLiterals and ignoreIdentifiers * ignoreLiterals: CPD ignores literal value differences when evaluating a duplicate block. This means that foo=42; and foo=43; will be seen as equivalent. * ignoreIdentifiers: Similar to ignoreLiterals but for identifiers; i.e., variable names, methods names, and so forth * like http://pmd.sourceforge.net/pmd-4.3.0/cpd.html
Highlighting fix with #945 |
@guwirth tried just now, and it no longer fails. i could check the new cpd thing and its detecting more that previous versions. most of those seem correct however when having typedef enum it seems its detecting everything as a duplications.. as a example
|
@jmecosta thanks a lot for testing and your feedback. |
remove deprecated cpd mapping
new algorithm: ignoreLiterals and ignoreIdentifiers