pmd

PMD xpath to suppress AtLeastOneConstructor and UnusedPrivateField?

こ雲淡風輕ζ 提交于 2019-12-21 05:45:12
问题 I have this piece of code and PMD reports two rule violations: AbstractExceptionHandler has no constructor (AtLeastOneConstructor) And the field uriInfo is a unused private field (UnusedPrivateField) @NoArgsConstructor public class AbstractExceptionHandler { // PMD AtLeastOneConstructor warning here /** the uriInfo injection. */ @Getter @Context private UriInfo uriInfo; // PMD UnusedPrivateField warning here both warnings are okay, but we use annotations to generate code. So the warning is

Can't use custom ruleset in maven-pmd-plugin 5.0.2

删除回忆录丶 提交于 2019-12-19 07:48:19
问题 I want maven-pmd-plugin to include rulesets that I specify and exclude some rules (specifically, UselessParentheses) Just like described in documentation, I placed the following in pmd.xml that is parent for all modules: <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.0</version> <configuration> <rulesets> <ruleset>/home/ubuntu/ruleset.xml</ruleset> </rulesets> </configuration> </plugin> </plugins> </reporting>

Can't use custom ruleset in maven-pmd-plugin 5.0.2

[亡魂溺海] 提交于 2019-12-19 07:48:04
问题 I want maven-pmd-plugin to include rulesets that I specify and exclude some rules (specifically, UselessParentheses) Just like described in documentation, I placed the following in pmd.xml that is parent for all modules: <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.0</version> <configuration> <rulesets> <ruleset>/home/ubuntu/ruleset.xml</ruleset> </rulesets> </configuration> </plugin> </plugins> </reporting>

PMD: DD/DU anomaly

徘徊边缘 提交于 2019-12-18 18:58:13
问题 I am using Eclipse with the PMD Plug-in (4.0.0.v20130510-1000) and get a lot of those violations: Found 'DD'-anomaly for variable 'freq' (lines '187'-'189'). Found 'DU'-anomaly for variable 'freq' (lines '189'-'333'). In this SO answer, it says that those anomalies are related to assigning values that are never read. But I get the violations for instance in this case: // here I get a DD anomaly double freq = 0; try { // here I get a DU anomaly freq = Double.parseDouble(getFrequencyTextField()

What are the differences between PMD and FindBugs?

元气小坏坏 提交于 2019-12-18 09:56:41
问题 There was a question comparing PMD and CheckStyle. However, I can't find a nice breakdown on the differences/similarities between PMD and FindBugs. I believe a key difference is that PMD works on source code, while FindBugs works on compiled bytecode files. But in terms of capabilities, should it be an either/or choice or do they complement each other? 回答1: I'm using both. I think they complement each other. As you said, PMD works on source code and therefore finds problems like: violation of

Checkstyle vs. PMD

 ̄綄美尐妖づ 提交于 2019-12-17 21:26:47
问题 We are introducing static analysis tools into the build system for our Java product. We are using Maven2 so Checkstyle and PMD integration come for free. However it looks like there is a large overlap in functionality between these two tools, in terms of enforcing basic style rules. Is there a benefit from utilizing both of these? I don't want to maintain 2 tools if one will work. If we choose one, which one should we use and why? We are also planning on using FindBugs. Are there other static

Installing PMD 5.0.4 in Eclipse

纵然是瞬间 提交于 2019-12-17 20:36:52
问题 Can anybody tell me how to install PMD in Eclipse. I have downloaded PMD 5.0.4 from the following link: http://sourceforge.net/projects/pmd/files/latest/download?source=files When I add this archive file in Eclipse install option I am getting an error stating that "It could not find the file specified". 回答1: Just follow the directions on http://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/ I copied the direction here for you so you don't even have to click !! In Eclipse, click

RMII模式以太网PHY芯片DP83848C的应用

北战南征 提交于 2019-12-16 13:15:01
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 引言    DP83848C 是美国国家半导体公司生产的一款鲁棒性好、功能全、功耗低的10/100 Mbps单路物理层(PHY)器件。它支持MII(介质无关接口)和RMII(精简的介质无关接口),使设计更简单灵活;同时,支持10BASE~T和 100BASE-TX以太网外设,对其他标准以太网解决方案有良好的兼容性和通用性。   MII(Medium Independent InteRFace)是IEEE802.3u规定的一种介质无关接口,主要作用是连接介质访问控制层(MAC)子层与物理层(PH-Y)之间的标准以太网接口,负责MAC和PHY之间的通信。由于MII需要多达16根信号线,由此产生的I/O口需求及功耗较大,有必要对MII引脚数进行简化,因此提出了RMII(Reduced Medium Independent Interface,精简的介质无关接口),即简化了的MII。    1 硬件设计   1.1 电路设计   DP83848C的收发线路各是一对差分线,经过变比为1:1的以太网变压器后与网线相连。以太网变压器的主要作用是阻抗匹配、信号整形、网络隔离,以及滤除网络和设备双方面的噪音。典型应用如图1所示。      图2是DP83848C与MAC的连接电路。其中,Xl为50 MHz的有源振荡器。     

Unable to locate Source XRef to link to

可紊 提交于 2019-12-13 05:06:17
问题 I have a big maven project that uses the pmd plugin for code quality checks. since I started using the pmd plugin i get the following warning message: [WARNING] Unable to locate Source XRef to link to - DISABLED I googled and found that i need to implement the jxr plugin. so I add the following to the build property in the main pom.xml file. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.3</version> </plugin> welp it doesn't really

After Installing PMD in Luna in Prespective it is Not Showing?

 ̄綄美尐妖づ 提交于 2019-12-12 22:20:02
问题 I installed the Pmd Plugin in Eclipse Luna and in STS , in the installation history it is showing installed but it is not showing in the perspective, so I am not able to run my code through PMD . How can I fix that? 回答1: If installed via the Market place, you then need to enable it for each Project... Then select the ruleset you want to use. The PROBLEMS view will then show the violations. 回答2: I discovered that you need to turn on PMD for each project separately. Which make sense, because