c# - Default directory layout for Sonar -
i prepared sonar analizing c# project. installed sonar , sonar-runner , configured c# plugins (.net core, c# core, fxcop, gendarme, gallio, opencover , stylecop)
so far everythings works fine. in sonar see code statistics (locs , on) , see code violations. there no code coverage buts thats ok because not have tests.
the problem see violations regarding stylecop, shows code style problems. sure application must have other violations should detected fxcop , other plugins.
in image 1 can see shows violation stylecop. violations stylecop.
in sonar c# documentation have read can happen analysis succeeds few violations found, maybe because of wrong assambly direction. show sonar-runner.properties, maybe here cause of problems:
#----- default sonar server #sonar.host.url=http://localhost:9000 #----- postgresql #sonar.jdbc.url=jdbc:postgresql://localhost/sonar #sonar.jdbc.driver=org.postgresql.driver #----- mysql #sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useunicode=true&characterencoding=utf8 #sonar.jdbc.driver=com.mysql.jdbc.driver #----- oracle #sonar.jdbc.url=jdbc:oracle:thin:@localhost/xe #sonar.jdbc.driver=oracle.jdbc.driver.oracledriver #----- global database settings #sonar.jdbc.username=sonar #sonar.jdbc.password=sonar #----- default directory layout sonar.sources=src sonar.tests=src sonar.binaries=src #----- default source code encoding #sonar.sourceencoding=utf-8
i want list application structure:
-->projectmainfolder -->project.sln -->sonar-project.properties -->project1folder -->bin -->object -->properties -->project1.csproj -->project1main.cs -->project2folder -->bin -->object -->properties -->project2.csproj -->project2main.cs
so question again: why see stylecop violations , no violation fxcop, gendarme , on?
i want add together sonar-project.properties:
# optional description sonar.projectdescription=project description # project identification sonar.projectkey=vendor:project sonar.projectversion= 1.0 sonar.projectname= project # info required sonar sources=. sonar.language=cs sonar.sourceencoding=utf-8 #core c# settings sonar.dotnet.visualstudio.solution.file=project.sln
first should not set project specific settings in sonar-runner.properties file, should create "sonar-project.properties" file within solution , maintain there
second, in "sonar-project.properties" file, "sonar.sources" should set "." , shouldn't have "sonar.tests" nor "sonar.binaries"
all explained in documentation , applied in sample project.
c# plugins sonarqube
No comments:
Post a Comment