SonarTS icon indicating copy to clipboard operation
SonarTS copied to clipboard

Don't CPD calculation for typescript

Open kolesoffac opened this issue 4 years ago • 3 comments

I have project VueJs+TS an have log:

13:57:15.114 DEBUG: Load plugins
13:57:15.128 DEBUG: Load plugins (done) | time=14ms
13:57:15.141 DEBUG: API compatibility mode is enabled on plugin Stash [stash] (built with API lower than 5.2)
13:57:15.221 DEBUG: Plugins:
13:57:15.221 DEBUG: * SonarC# 6.5.0.3766 (csharp)
13:57:15.221 DEBUG: * SonarPython 1.8.0.1496 (python)
13:57:15.221 DEBUG: * SonarJava 4.15.0.12310 (java)
13:57:15.221 DEBUG: * Flex 2.3 (flex)
13:57:15.222 DEBUG: * SonarQube :: Plugins :: SCM :: Git 1.3.0.869 (scmgit)
13:57:15.222 DEBUG: * SonarXML 1.4.3.1027 (xml)
13:57:15.222 DEBUG: * SonarPHP 2.11.0.2485 (php)
13:57:15.222 DEBUG: * SonarTS 1.9.0.3766 (typescript)
13:57:15.222 DEBUG: * SonarQube :: Plugins :: SCM :: SVN 1.6.0.860 (scmsvn)
13:57:15.222 DEBUG: * SonarJS 5.2.0.7766 (javascript)
13:57:15.222 DEBUG: * Stash 1.3.0 (stash)
13:57:15.236 DEBUG: Execution getVersion
13:57:15.237 INFO: SonarQube server 6.7.7
13:57:15.237 INFO: Default locale: "en_US", source code encoding: "UTF-8"
13:57:15.238 DEBUG: Execution getVersion
13:57:15.238 DEBUG: Execution execute
13:57:15.691 INFO: Process project properties
13:57:15.697 DEBUG: Process project properties (done) | time=6ms
13:57:15.697 INFO: Execute project builders
13:57:15.698 INFO: Execute project builders (done) | time=1ms
13:57:15.803 INFO: Load project repositories
13:57:15.923 INFO: Load project repositories (done) | time=120ms
13:57:16.008 DEBUG: Available languages:
13:57:16.008 DEBUG: * C# => "cs"
13:57:16.008 DEBUG: * Python => "py"
13:57:16.009 DEBUG: * Java => "java"
13:57:16.009 DEBUG: * Flex => "flex"
13:57:16.009 DEBUG: * XML => "xml"
13:57:16.009 DEBUG: * PHP => "php"
13:57:16.009 DEBUG: * TypeScript => "ts"

13:57:17.396 INFO: Source paths: src 13:57:17.396 INFO: Test paths: tests 13:57:17.397 INFO: Source encoding: UTF-8, default locale: en_US 13:57:17.500 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : /.cs 13:57:17.500 DEBUG: Declared extensions of language Python were converted to sonar.lang.patterns.py : **/.py 13:57:17.501 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : /*.java,/.jav 13:57:17.501 DEBUG: Declared extensions of language Flex were converted to sonar.lang.patterns.flex : **/.as 13:57:17.501 DEBUG: Declared extensions of language XML were converted to sonar.lang.patterns.xml : /*.xml,/*.xsd,/.xsl 13:57:17.501 DEBUG: Declared extensions of language PHP were converted to sonar.lang.patterns.php : **/.php,/*.php3,/.php4,**/.php5,/*.ph tml,/.inc 13:57:17.502 DEBUG: Declared extensions of language TypeScript were converted to sonar.lang.patterns.ts : **/.ts,/*.tsx,/.vue 13:57:17.502 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/.js,**/*.jsx 13:57:17.509 DEBUG: Initializers : 13:57:17.510 INFO: Index files 13:57:17.518 INFO: Excluded sources: 13:57:17.518 INFO: /tests/ 13:57:18.593 INFO: Sensor SonarJavaXmlFileSensor [java] 13:57:18.597 INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=4ms 13:57:18.598 INFO: Sensor Analyzer for "php.ini" files [php] 13:57:18.602 INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=4ms 13:57:18.602 INFO: Sensor SonarTS [typescript] 13:57:18.608 DEBUG: It will be used for analysis of typescript files 13:57:18.924 DEBUG: Checking node version 13:57:18.942 DEBUG: Using Node.js v12.13.1 13:57:18.945 INFO: Analyzing 95 typescript file(s) with the following configuration file frontend/tsconfig.json 13:57:21.586 ERROR: Failed to find a source file matching path /frontend/src/views/view1.vue in program created with frontend/tsconfig.json 13:57:21.593 INFO: 95 files analyzed out of 95 ... 13:57:21.719 DEBUG: Not enough content in 'src/App.vue' to have CPD blocks, it will not be part of the duplication detection ... 13:57:22.029 INFO: Sensor SonarTS [typescript] (done) | time=3427ms 13:57:22.029 INFO: Sensor SonarTS Coverage [typescript] 13:57:22.031 INFO: Analysing [frontend/coverage/lcov.info] 13:57:22.111 INFO: Sensor SonarTS Coverage [typescript] (done) | time=82ms 13:57:22.111 INFO: Sensor Zero Coverage Sensor 13:57:22.181 INFO: Sensor Zero Coverage Sensor (done) | time=70ms 13:57:22.181 INFO: Sensor CPD Block Indexer 13:57:22.181 DEBUG: org.sonar.scanner.cpd.deprecated.DefaultCpdBlockIndexer is used for ts 13:57:22.182 DEBUG: No CpdMapping for language ts 13:57:22.182 INFO: Sensor CPD Block Indexer (done) | time=1ms .... 13:57:22.215 INFO: SCM provider for this project is: git 13:57:22.217 INFO: 1 files to be analyzed 13:57:22.248 DEBUG: readpipe [git, --version],/usr/bin 13:57:22.265 DEBUG: readpipe may return 'git version 2.17.1' 13:57:22.265 DEBUG: remaining output:

13:57:22.265 DEBUG: readpipe [git, config, --system, --edit],/usr/bin 13:57:22.267 DEBUG: readpipe may return '/etc/gitconfig' 13:57:22.267 DEBUG: remaining output: .... 13:57:22.583 INFO: 59 files had no CPD blocks 13:57:22.584 INFO: Calculating CPD for 36 files 13:57:22.586 DEBUG: Detection of duplications for frontend/src/models/model1.ts ... 13:57:22.629 INFO: CPD calculation finished 13:57:23.016 INFO: Analysis report generated in 342ms, dir size=296 KB 13:57:23.288 INFO: Analysis reports compressed in 272ms, zip size=221 KB ... 13:57:23.308 INFO: Analysis report uploaded in 20ms 13:57:23.309 INFO: ANALYSIS SUCCESSFUL, you can browse

TypeScript version: 3.4.3

Why dont CPD calculation for my project?

kolesoffac avatar Feb 04 '20 07:02 kolesoffac

hello @kolesoffac,

you are using very outdated versions of SonarQube and SonarTS / SonarJS plugins. Can you please upgrade at least to the latest SonarQube LTS 7.9.2 and SonarJS 6.2? I am afraid we will be not able to help you with old versions.

saberduck avatar Feb 04 '20 10:02 saberduck

I upgrade:

  • SonarQube LTS
  • SonarJS 6.2
  • SonarTS 2.1

Result same.

kolesoffac avatar Feb 04 '20 14:02 kolesoffac

@kolesoffac can you please send the debug log with the new version? Is the cpd not computed only for Vue.js files?

saberduck avatar Feb 10 '20 10:02 saberduck