Can Not Be Decided as the File Matches Patterns of Both Sonar.lang.patterns.cpp :

The analsis parameter defines a list of suffixes of CXX files to analyze.

The reading in of source files (indexing) is a prerequisite for the subsequent reading in and visualisation of reports of external tools. The programming language sensor is often also called squid sensor.

In SonarQube, each file extension must be uniquely assigned to one programming language. When operating several C/C++ plugins in parallel, this must be taken into business relationship during configuration. To avoid problems on a SonarQube Server with multiple C++ plugins, the CXX programming language sensor is disabled by default.

sonar-project.properties sample:

          # default: the cxx plugin language sensor is disabled sonar.cxx.file.suffixes=-                  

This configuration parameter must therefore be set explicitly to utilise the CXX programming linguistic communication sensor. The recommended settings are:

programming language recomended file suffixes
C++ .cc,.cpp,.cxx,.c++,.hh,.hpp,.hxx,.h++,.ipp
C .c,.h
CXX (v1.ten) .cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h

Sample to be cxx plugin version 1.x compatible (sonar-projection.backdrop):

          # mandatory parameter: files to exist handled past the cxx plugin sonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h                  

In the SonarQube UI, enter the file suffixes into the fields one by one.

Scan Source Code

The SonarCFamily for C/C++ is using the analysis parameter sonar.c.file.suffixes for C, sonar.cpp.file.suffixes for C++ and sonar.objc.file.suffixes for Objective-C. If you lot don't desire to analyze C/C++/Objective-C files with the SonarCFamily plugin, and so prevent them from being analyzed past setting the following properties:

          sonar.c.file.suffixes=- sonar.cpp.file.suffixes=- sonar.objc.file.suffixes=-                  

Understanding the scanner .LOG file

The listing below shows an example of the contents of a scanner .LOG file and describes the specific steps. In order to get all required information, the debug information should be switched on during scanning.

Await for the entry sonar.lang.patterns.cxx in the .LOG file. This should exist a comma-separated list with one entry in the form .xxx => **/*.xxx for each file extension.

          15 DEBUG: Available languages: 16 DEBUG:   * CXX => "cxx" 17 DEBUG: Declared extensions of language CXX were converted to sonar.lang.patterns.cxx : **/*.cxx,**/*.cpp,**/*.cc,**/*.c,**/*.hxx,**/*.hpp,**/*.hh,**/*.h                  

If the configuration is correct, all files with the respective file extensions are then assigned to the programming language cxx in the step Indexing files.

          19 INFO: Indexing files... 20 INFO: Project configuration: 21 DEBUG: 'src/component1.hh' indexed with language 'cxx' 22 DEBUG: 'src/component1.cc' indexed with language 'cxx' 23 DEBUG: 'src/main.cc' indexed with language 'cxx' 24 INFO: 3 files indexed                  

If a file extension is assigned to more than one language (or plugin), you will get an mistake message like below:

          xxx Error: Language of file 'sample.cpp' can non be decided equally the file matches patterns of both sonar.lang.patterns.cxx : ... and sonar.lang.patterns.cpp : ...                  

rodrigueztwentone.blogspot.com

Source: https://github-wiki-see.page/m/SonarOpenCommunity/sonar-cxx/wiki/sonar.cxx.file.suffixes

0 Response to "Can Not Be Decided as the File Matches Patterns of Both Sonar.lang.patterns.cpp :"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel