PMD使用手记

DPDK之PMD原理 具体的行为向/sys/bus/pci/devices/(pci id)/driver_override写入指定驱动名称,或者向/sys/bus/pci/drivers/igb_uio(驱动名称)/new_id写入要绑定网卡的PCI ID。在pci_uio_map_resource函数中,除了调用上图中的pci_uio_alloc_resource,还会调用pci_uio_map_resource_by_index做资源映射。以最简单的e1000驱动为例,在其初始化函数eth_igb_dev_init中, 阅读详情
1)一次用多个规则集进行检查不成功
命令行:
E:/software/pmd-2.3/bin>pmd C:/Test.java html rulesets/unusedcode.xml,rulesets/basic.xml
运行结果:
<html><head><title>PMD</title></head><body>
<table align="center" cellspacing="0" cellpadding="3"><tr>
<th>#</th><th>File</th><th>Line</th><th>Problem</th></tr>
</table></body></html>
示例源码:
import java.util.ArrayList;
import java.util.*;
public class Test {
        public static void main(String[] args) {
             try{
                int i=0;
                if(i>0) {}
                System.out.println("Hello World!");
            } catch(Exception e) {
            } finally{
            }
       }
}
2)使用上述示例源码运行成功的例子:
命令行:E:/software/pmd-2.3/bin>pmd C:/Test.java html rulesets/basic.xml
运行结果: 
#FileLineProblem
1C:/Test.java11Avoid empty 'if' statements
2C:/Test.java15Avoid empty catch blocks
3C:/Test.java16Avoid empty finally blocks
编写自己的PMD规则 目标:搭建基于maven的app工程,编写自定义PMD规则,可运行单元测试,可debug。 一、环境搭建 1. 在想要建立工程的地方,运行 "mvn archetype:create -DgroupId=com.alipay.codecheck -DartifactId=codecheck" 命令搭建一个app工程 2. 修改根目录pom.xml,管理jar包依赖: a) 阅读详情

相关推荐

全面剖析PMD静态代码扫描工具

最近需要调研静态代码扫描工具cong1     调研对象pmd-bin-6.4.0【PMD可执行版本】·      bin·      designer.bat【界面工具,能将java源代码转化为AST(抽象语法树),个人推荐使用】·      bgastviewer.bat【界面工具,与designer.bat功能相似】·      cpd.bat【用来查找重复代码的工具,命令行版】·     ...

zlx312的博客 1万+

java pmd eclipse_eclipse pmd的使用

1.Avoidunnecessary Comparisons in Boolean exception.(Boolean类型重复判断)错误 例子: if(null! = a && a.size>0)正确 if(null! = a && false == a.IsEmpay())2. Avoid Usingimplementation ty...

weixin_26966397的博客 2114

dpdk pmd驱动分析

如上所以new_id 对应的驱动处理函数为store_new_id, bind对应的处理函数为driver_bind,unbind对应的处理函数为driver_unbind。new_id操作new_id主要就是将设备ID加入至驱动动态设备ID列表,供后面驱动设备匹配时(probe)使用。bind操作bind操作通过传入的设备标识找到具体的设备抽象,与驱动记录的设备ID进行匹配,匹配成功后进行probe。unbind操作unbind操作通过传入的设备标识找到具体的设备抽象后进行释放。

lingshengxiyou的博客 1445

TPTP Code Review规则

  Rule 规则 AWT Avoid using java.awt.peer interface directly 不要直接使用java.awt.peer接口 Casting Avoid returning java.lang.Object,downcast to specific type instead ...

qiuqiao的专栏 235

PMD详细介绍

一、PMD概述 1.1、工具说明 PMD是一个代码检查工具,它用于分析Java源代码,找出潜在的问题。 PMD的核心是JavaCC解析器生成器。PMD附带了16个可以直接使用的规则信,利用这些规则可以找出Java源程序的许多问题;此外,PMD规则是可以定制的,可以添加新规则:通过编写Java代码并重新编译PDM,或者更简单些,编写XPath表

武天旭的博客 3553

PMD与CPD使用说明

PMD与CPD使用说明,检查Java代码的重复度

eclipse pmd的使用

上篇讲了findbugs的使用,这篇就来说下pmd的使用。 PMD是一种开源分析Java代码错误的工具。与其他分析工具不同的是,PMD通过静态分析获知代码错误。也就是说,在不运行Java程序的情况下报告错误。PMD附带了许多可以直接使用的规则,利用这些规则可以找出Java源程序的许多问题。此外,用户还可以自己定义规则,检查Java代码是否符合某些特定的编码规范。 因为好像直接在ecli

Losileeya 1万+

PMBlog:PHP版静态化博客程序,支持自定义主题和插件

PMBlog PMBlog是一个类似Jekyll / OctopressPHP版静态博客生成程序。具有文章/页面的生成,自定义主题,自定义插件等基本功能。 关于采用自定义主题,这里想要感谢Twig。之前采用的是自己写的模板引擎,本身自己麻烦,而且做主题也很麻烦,因为又需要记一套语法。采用了开源的Twig模板引用(语法来自Django和Jinjia,和Jekyll,Octopress的语法是类似的)擎之后,开发主题就变得非常的得心应手了。 关于自定义插件,这里想要感谢Pico。Pico是一种静态CMS程序,参考了它的代码,我才能将PMBlog的插件系统给开发出来,这里真是非常感谢! 必要条件

PMD Results

PMD Results The following document contains the results of PMD 6.8.0. Files org/apache/ibatis/builder/MapperBuilderAssistant.java Violation Priority Line Avoid empty catch blocks 3 430–432 org/apa...

[Blog][Domain] programb.blog.youkuaiyun.com 832

PostgreSQL中idle in transaction状态的5个隐藏危害及实战解决方案

本文深入剖析了PostgreSQL中`idle in transaction`连接状态的五大隐藏危害,包括内存与锁泄漏、VACUUM受阻导致表膨胀、事务ID加速消耗、连接池资源耗尽以及增加故障排查复杂度。文章提供了基于`pg_stat_activity`视图的监控方法、识别高危事务的SQL脚本,并给出了从数据库参数调优(如设置`idle_in_transaction_session_timeout`)到应用层编码规范与连接池配置的完整实战解决方案。

zzz56的博客 234

Modelsim10.5_se安装(Win11)

modelsim是Mentor公司开发的优秀的HDL语言仿真软件。它能提供友好的仿真环境,采用单内核支持VHDL和Verilog混合仿真的仿真器。它采用直接优化的编译技术、Tcl/Tk技术和单一内核仿真技术,编译仿真速度快且编译的代码与平台无关。

m0_51186267的博客 9908

Sonar

Avoid long parameter lists. 方法参数过多,最多允许5个 Missing a Javadoc comment. 需要注释 Expected @param tag for 'area'. 需要注释 Expected @return tag. ...

qq_33865313的博客 2万+

西南交通大学车辆工程专业大四上车辆综合实训ame仿真部分

西南交通大学车辆工程专业大四上车辆综合实训ame仿真建模部分

qq_64814052的博客 1244

基于PMD的静态测试

基于PMD的静态测试 文章目录一.安装PMD二、使用步骤1.首先建立一个Text包,然后新建一个测试类2.右击项目工程文件夹,选择 PMD→Find Suspect Cut And Paste3.右击项目文件夹,选择 PMD→Check Code,即执行 PMD 菜单: 一.安装PMD 1.首先,默认已经安装了Eclipse,然后打开Eclipse在菜单处找到“Help”,然后选择“Eclipse MarketPlace” 2.在Find中输入:PMD,然后回车 在这里选择红色的PMD进行安装。 3.在

weixin_51156816的博客 2736

Zotero插件安装保姆级教程:从Jasminum到Sci-Hub,一站式搞定文献管理

本文提供Zotero插件安装的保姆级教程,从Jasminum到Sci-Hub,一站式搞定文献管理。通过详细配置和实战案例,帮助用户高效构建文献工作流,提升研究效率。重点介绍了元数据抓取、PDF管理、文献分析和知识产出等关键插件的使用方法。

weixin_42531516的博客 169

R语言实战:GEO单细胞数据下载与自动化整理全流程(附代码)

本文详细介绍了使用R语言从GEO数据库下载scRNA-seq数据并实现自动化整理的完整流程。通过GEOquery和Seurat等工具包,读者可以高效获取单细胞RNA测序数据,完成从原始数据下载到预处理的全过程,最终生成可直接用于分析的Seurat对象。文章包含完整代码示例,特别适合生物信息学研究者处理单细胞数据。

weixin_29061821的博客 427

pmd eclipse插件_eclipse-pmd – Eclipse的新PMD插件

pmd eclipse插件 我是Eclipse用户。 因此,当我想通过PMD分析我的代码时,我需要使用“ PMD for Eclipse”插件。 该插件以前非常有错误,在更高版本(当前为4.0.3)中得到了增强。 但是有时候性能确实很差。 特别是在处理相对较大的代码库并启用“保存后检查代码”选项时。 ecplise-pmd插件 因此,当我意识到那里有一个名为eclipse-pmd的新PMD...

danpu0978的博客 898

PostgreSQL数据库全攻略:从入门到精通

本文是一份PostgreSQL数据库综合指南,涵盖安装配置、基础操作和高级管理。主要内容包括:1) PostgreSQL简介与各平台安装方法;2) 数据库基本操作,如创建数据库/表、CRUD操作、用户权限管理;3) 高级功能包括索引优化、事务控制、视图、存储过程、触发器和扩展模块;4) 数据库管理维护,涉及配置调优、备份恢复、性能监控和日常维护;5) 安全设置与高可用方案。指南提供了从入门到进阶的实用知识,强调结合官方文档进行深入学习,帮助用户高效使用这一功能强大的开源关系型数据库系统。

索大神的博客 1969

5分钟学会PMD

5分钟快速入门PMD静态代码分析,与maven构建流程集成,提供笔者常用的静态代码分析规则

weixin_68419854的博客 1247

安装Office程序时无法安装的解决方案

本文主要介绍了安装Office程序时无法安装的解决方案,希望能对安装Office的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案 2.1 前置步骤 2.2 方法一 2.3 方法二

weixin_43178406的博客 15万+

12、多端神经形态晶体管:原理、应用与算法探索

本文综述了多端神经形态晶体管的原理、应用与算法探索。从神经元MOS晶体管的发展到基于电解质栅极晶体管(EGT)的新型器件设计,系统阐述了其在低电压、多功能逻辑运算和突触行为模拟方面的优势。重点介绍了其在化学生物传感器(如多巴胺和pH检测)中的高灵敏度应用,以及在树突整合、时空总和、动态逻辑和神经元算术等树突算法中的实现。文章还总结了该类器件在神经形态计算、智能传感等领域的广阔前景,并分析了当前面临的材料工艺、理论建模与系统集成挑战,展望了未来发展方向。

delta的博客 143

Eclipse安装PMD插件

Eclipse安装PMD插件

Raine's blog 1万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

PMD (别向报信者开火)

PMD 是一款非常实用的 **跨语言静态代码分析工具** (Cross-language Static Code Analyzer),它能运行于不同平台且实用简单。PMD 与其他代码分析工具最大的不同在于它不用通过编译过程(即 静态),这样能让分析者更能聚焦到代码本身的特点,而不用担心代码是否编译成功。

Yongfeng's Blog 2979

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Maven – PMD示例

在本文中,我们将向您展示如何使用Maven PMD插件来分析Java代码。 PS PMD需要Java 1.7 1. Maven PMD插件 在reporting标记中定义maven-pmd-plugin ,以便mvn site将生成PMD报告。 pom.xml <reporting> <plugins> ...

一名可爱的技术搬运工 2584

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

上一篇: JSF
下一篇: csdn对firefox示好?
hitgnu
博客等级 码龄23年 1粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值