SonarQube扫描运行但未生成任何结果

如何解决SonarQube扫描运行但未生成任何结果

我第一次运行SonarQube扫描。这是CE版本8.3.1。

我在192.168.56.111的服务器上运行了SQ。我的开发工作站在192.168.0.11上。没有网络问题。

由于我是SQ的新手,所以我尝试使其保持尽可能的基本。我在https://github.com/SonarSource/sonar-scanning-examples/blob/master/sonarqube-scanner-maven/maven-basic/src/main/java/com/acme/basic/

中使用示例HelloWorld。

我没有使用Git。只需将HelloWorld项目保存到本地硬盘中

源代码位于/ opt / workspace / eclipse / java / my-app / src / main / java / com / mycompany / app /

扫描仪位于/opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/bin

这是属性文件的副本。无论是否将其放在扫描仪的conf目录或应用程序工作区中,我都使用相同的文件……我看到了不同的网页,它们都出现在任一位置:

sonar.host.url=http://192.168.56.111:9000

sonar.sourceEncoding=UTF-8

sonar.projectKey=com.mycompany.app:my-app

sonar.scm.disabled=True

sonar.sources=/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app

sonar.login=73a9a7ab66a335d0d83aee813d576e184934a336

当我运行声纳扫描仪然后检查结果时,姓名|概述,其中显示“主分支没有代码行”。

问题#1:如果sonar.scm.disabled = true位于props文件中,那么如何发生此错误?我还进入了SQ服务器中的项目设置,并在那里也禁用了SCM传感器。结果相同。

问题2:我在终端输出中注意到,它说.java文件被忽略。因此,我将sonar.sources属性更改为类文件位于的位置:/ opt / workspace / eclipse / java / my-app / target / classes / com / mycompany / app /。结果相同。 sonar.sources属性应该是什么? SQ对Java文件或类文件有效吗?

结果显示“没有问题。哇!”因此,我在HelloWorld类的sayHello方法中添加了这个但很丑陋的方法:

KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(1024);

问题3:仍然没有代码问题。 SQ应该标明1024(小于2048)的大小对吧?

====编辑8月23日====

根据@HernánAlarcón的评论从终端添加输出。

INFO: Scanner configuration file: /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 3.10.0-1127.10.1.el7.x86_64 amd64
INFO: User cache: /home/dogzilla/.sonar/cache
INFO: Scanner configuration file: /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.3.1
INFO: Default locale: "en_US",source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=69ms
INFO: Server id: A7EE8CF2-AXMiwj91ZEnoz7IhXD_G
INFO: User cache: /home/dogzilla/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=36ms
INFO: Load/download plugins (done) | time=86ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: com.mycompany.app:my-app
INFO: Base dir: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app
INFO: Working dir: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app/.scannerwork
INFO: Load project settings for component key: 'com.mycompany.app:my-app'
INFO: Load project settings for component key: 'com.mycompany.app:my-app' (done) | time=17ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=40ms
INFO: Load active rules
INFO: Load active rules (done) | time=851ms
INFO: Indexing files...
INFO: Project configuration:
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/HelloWorld.java' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/AppRunner.java' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/sonar-scanner.properties' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
INFO: 0 files indexed
INFO: ------------- Run sensors on module com.mycompany.app:my-app
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=38ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/dogzilla/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS,PHP,HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported,no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: SCM Publisher is disabled
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 70ms,dir size=77 KB
INFO: Analysis report compressed in 12ms,zip size=9 KB
INFO: Analysis report uploaded in 35ms
INFO: ANALYSIS SUCCESSFUL,you can browse http://192.168.56.111:9000/dashboard?id=com.mycompany.app%3Amy-app
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://192.168.56.111:9000/api/ce/task?id=AXQeYMFVCyJo7mZCTWSk
INFO: Analysis total time: 2.802 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.561s
INFO: Final Memory: 6M/37M
INFO: ------------------------------------------------------------------------

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-