Skip to content
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

Merged
merged 1 commit into from
Sep 11, 2016
Merged

replace deprecated cpd mapping #941

merged 1 commit into from
Sep 11, 2016

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented Sep 8, 2016

remove deprecated cpd mapping

  • 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

@guwirth guwirth added this to the 0.9.7 milestone Sep 9, 2016
@guwirth guwirth self-assigned this Sep 9, 2016
@guwirth
Copy link
Collaborator Author

guwirth commented Sep 9, 2016

new algorithm: ignoreLiterals and ignoreIdentifiers

@ALL maybe you can have a look if this is working for you?

@jmecosta
Copy link
Member

jmecosta commented Sep 10, 2016

@guwirth not related with this pr, but the highligting feature is throwing a exception
ERROR: Error during SonarQube Scanner execution
[12:30:53][Step 1/1] org.sonar.squidbridge.api.AnalysisException: Unable to analyze file: E:\prod\structures\src\work\Core\Common\libfilesystem\tool_sys_io_util.cpp
[12:30:53][Step 1/1] at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:131)
[12:30:53][Step 1/1] at org.sonar.plugins.cxx.squid.CxxSquidSensor.execute(CxxSquidSensor.java:128)
[12:30:53][Step 1/1] at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
[12:30:53][Step 1/1] at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
[12:30:53][Step 1/1] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
[12:30:53][Step 1/1] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[12:30:53][Step 1/1] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
[12:30:53][Step 1/1] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[12:30:53][Step 1/1] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
[12:30:53][Step 1/1] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
[12:30:53][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[12:30:53][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[12:30:53][Step 1/1] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[12:30:53][Step 1/1] at java.lang.reflect.Method.invoke(Method.java:498)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[12:30:53][Step 1/1] at com.sun.proxy.$Proxy0.execute(Unknown Source)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
[12:30:53][Step 1/1] at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
[12:30:53][Step 1/1] at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
[12:30:53][Step 1/1] at org.sonarsource.scanner.cli.Main.main(Main.java:60)
[12:30:53][Step 1/1] Caused by: java.lang.IllegalArgumentException: Unable to highlight fileoduleKey=tekla.structures.core:Common, relative=libfilesystem/tool_sys_io_util.cpp, basedir=E:\prod\structures\src\work\Core\Common]
[12:30:53][Step 1/1] at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:98)
[12:30:53][Step 1/1] at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:36)
[12:30:53][Step 1/1] at org.sonar.plugins.cxx.highlighter.CxxHighlighter.highlight(CxxHighlighter.java:145)
[12:30:53][Step 1/1] at org.sonar.plugins.cxx.highlighter.CxxHighlighter.visitToken(CxxHighlighter.java:127)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitToken(AstWalker.java:107)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:86)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:69)
[12:30:53][Step 1/1] at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:110)
[12:30:53][Step 1/1] ... 31 more
[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
[12:30:53][Step 1/1] at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
[12:30:53][Step 1/1] at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:218)
[12:30:53][Step 1/1] at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:209)
[12:30:53][Step 1/1] at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:240)
[12:30:53][Step 1/1] at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:96)

@guwirth
Copy link
Collaborator Author

guwirth commented Sep 10, 2016

@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?

Am 10.09.2016 um 11:39 schrieb Jorge Costa [email protected]:

@guwirth not related with this pr, but the highligting feature is throwing a exception

ERROR: Error during SonarQube Scanner execution
[12:30:53][Step 1/1] org.sonar.squidbridge.api.AnalysisException: Unable to analyze file:
[12:30:53][Step 1/1] at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:131)
[12:30:53][Step 1/1] at org.sonar.plugins.cxx.squid.CxxSquidSensor.execute(CxxSquidSensor.java:128)
[12:30:53][Step 1/1] at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
[12:30:53][Step 1/1] at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
[12:30:53][Step 1/1] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
[12:30:53][Step 1/1] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
[12:30:53][Step 1/1] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[12:30:53][Step 1/1] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
[12:30:53][Step 1/1] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[12:30:53][Step 1/1] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[12:30:53][Step 1/1] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
[12:30:53][Step 1/1] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
[12:30:53][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[12:30:53][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[12:30:53][Step 1/1] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[12:30:53][Step 1/1] at java.lang.reflect.Method.invoke(Method.java:498)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[12:30:53][Step 1/1] at com.sun.proxy.$Proxy0.execute(Unknown Source)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
[12:30:53][Step 1/1] at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
[12:30:53][Step 1/1] at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
[12:30:53][Step 1/1] at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
[12:30:53][Step 1/1] at org.sonarsource.scanner.cli.Main.main(Main.java:60)
[12:30:53][Step 1/1] Caused by: java.lang.IllegalArgumentException: Unable to highlight fileoduleKey=]
[12:30:53][Step 1/1] at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:98)
[12:30:53][Step 1/1] at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:36)
[12:30:53][Step 1/1] at org.sonar.plugins.cxx.highlighter.CxxHighlighter.highlight(CxxHighlighter.java:145)
[12:30:53][Step 1/1] at org.sonar.plugins.cxx.highlighter.CxxHighlighter.visitToken(CxxHighlighter.java:127)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitToken(AstWalker.java:107)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:86)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)
[12:30:53][Step 1/1] at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:69)
[12:30:53][Step 1/1] at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:110)
[12:30:53][Step 1/1] ... 31 more
[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
[12:30:53][Step 1/1] at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
[12:30:53][Step 1/1] at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:218)
[12:30:53][Step 1/1] at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:209)
[12:30:53][Step 1/1] at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:240)
[12:30:53][Step 1/1] at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:96)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@jmecosta
Copy link
Member

@guwirth just a comment.


/**** EXIST FILE ? ****/

@guwirth
Copy link
Collaborator Author

guwirth commented Sep 10, 2016

@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?

@jmecosta
Copy link
Member

    const std::regex RegexEscape(R"([.^$|()\[\]{}*+?\\])");

sorry wrong file

@guwirth
Copy link
Collaborator Author

guwirth commented Sep 10, 2016

@jmecosta
Copy link
Member

@guwirth ive put it here #943

* 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
@guwirth
Copy link
Collaborator Author

guwirth commented Sep 11, 2016

Highlighting fix with #945

@guwirth guwirth merged commit 0abe151 into SonarOpenCommunity:master Sep 11, 2016
@jmecosta
Copy link
Member

@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

typedef enum ABC {
    ABC           = 12,
    DEF           = 13,
} ABC_e;

typedef enum DEF {
    ABC           = 14,
    DEF           = 15,
} DEF_e;

@guwirth
Copy link
Collaborator Author

guwirth commented Sep 11, 2016

@jmecosta thanks a lot for testing and your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants