html去除重复代码,simian 查找项目中的重复代码
证明文件是完整的,可忽略
然后解压simian-2.5.10.tar.gz,并把解压后的文件放到D:Program_Filessimian-2.5.10目录下
使用bin目录下的jar
执行命令,从src目录下找到重复3行的重复代码,并将找到的结果放入D:esult.txt中
java -jar D:Program_Filessimian-2.5.10insimian-2.5.10.jar -threshold=3 "D:workspaceideafathersrc***.java" >> D:esult.txt
Simian命令行的格式:
java -jar simian.jar [options] [files]
Usage: [options] [files]
命令
描述
-balanceCurlyBraces[+/-]
Accounts for curly braces when breaking lines
-balanceParentheses[+/-]
Accounts for parentheses when breaking lines
-balanceSquareBrackets[+/-]
Accounts for square brackets when breaking lines
-config=FNAME
Reads the configuration from the specifiedfile
-defaultLanguage=LANG
Assumes files are in the specified language if none can be inferred
-excludes=SPEC
Excludes files matching the specified pattern
-failOnDuplication[+/-/%]
Exits with a failure return code if duplication detected
-formatter=TYPE[:FNAME]
Uses the specified output format when reporting
-ignoreBlocks=START:END
Ignores all lines between START/END
-ignoreCharacterCase[+/-]
Matches character literals irrespective of case
-ignoreCharacters[+/-]
Completely ignores character literals
-ignoreCurlyBraces[+/-]
Completely ignores curly braces
-ignoreIdentifierCase[+/-]
Matches identifiers irresepctive of case
-ignoreIdentifiers[+/-]
Completely ignores identifiers
-ignoreLiterals[+/-]
Completely ignores all literals (strings, numbers and characters)
-ignoreModifiers[+/-]
Ignores modifiers (public, private, static, etc.)
-ignoreNumbers[+/-]
Completely ignores numbers
-ignoreOverlappingBlocks[+/-]
Ignores blocks that wholly or partially overlap
-ignoreRegions[+/-]
Ignores all lines between #region/#endregion
-ignoreStringCase[+/-]
Matches string literals irrespective of case
-ignoreStrings[+/-]
Completely ignores the contents of strings
-ignoreSubtypeNames[+/-]
Matches on similar type names (eg. Reader and FilterReader)
-ignoreVariableNames[+/-]
Completely ignores variable names (fields, parameters and locals)
-includes=SPEC
Including files matching the specified pattern
-language=LANG
Assumes ALL files are in the specified language
-reportDuplicateText[+/-]
Prints the duplicate text in reports
-threshold=COUNT
Matches will contain at least the specified number of lines
示例说明:
一些参数:
检查包括子目录下的所有的c#文件:
"-recurse=*.cs"
检查当前目录下的所有c#文件 ,并且只检查代码3行以上重复的代码
-threshold=3 "*.cs"
在当前目录的所有子文件夹下检测所有c和h后缀的文件:
**/*.c **/*.h
检测两个不同目录下的所有java文件:
"/csharp-source/*.cs" "/java-source/*.java"
检测所有子目录下的所有java文件,包括test类:
-includes=**/*.java -excludes=**/*Test.java
检测当前目录下的所有java文件,且忽略其中的数字的不同:
-ignoreNumbers "*.java"
检测所有java文件,并以xml格式显示结果:
-formatter=xml "*.rb"
从文件中读取配置参数(文件中一行只能包括一个simian有效的参数):
-config=simian.config
html去除重复代码,simian 查找项目中的重复代码相关推荐
- 题目:查找数组中的重复数字,要求空间复杂度为O(1)(基于Java实现)
题目:查找数组中的重复数字,要求空间复杂度为O(1)(基于Java实现) 题目: 在一个长度为 n 的数组 nums 里的所有数字都在 0-n-1 的范围内.数组中某些数字是重复的,但不知道有几个数字 ...
- Java-Runoob-高级教程-实例-数组:10. Java 实例 – 查找数组中的重复元素-un
ylbtech-Java-Runoob-高级教程-实例-数组:10. Java 实例 – 查找数组中的重复元素 1.返回顶部 1. Java 实例 - 查找数组中的重复元素 Java 实例 以下实例 ...
- 网页中调用matlab,在C#的Web项目中调用Matlab代码的步骤
在C#的Web项目中调用Matlab代码的方法 为了毕设的图形检索方向的研究,本人需要在信科的师兄师姐们已经完成的C#界面中,调用现在研究的算法的Matlab代码,以便看到实验的效果.前段时间已经拖延 ...
- OpenCV演示代码以查找图像中的轮廓(附完整代码)
OpenCV演示代码以查找图像中的轮廓 OpenCV演示代码以查找图像中的轮廓 OpenCV演示代码以查找图像中的轮廓 #include "opencv2/imgcodecs.hpp&quo ...
- 在项目中这样写代码的时候,请搭配红花油、跌打损伤酒一起使用
前言 前几天,正巧赶上组里代码review,一下午下来,感觉整个人都血压拉满了.五花八门的代码让我不禁感叹,代码规范这条道路还是任重而道远- 那么今天就来给大家总结一波Java中的代码小技巧,熟练掌握 ...
- 如何减少项目中的冗余代码?
如何减少项目中的冗余代码? 前言 为什么会出现冗余代码 如何解决 提取公共请求/业务逻辑 聚合函数的收敛 能合并的函数进行合并 善用配置表思维 再会 前言 随着业务的不断迭代,项目代码会变得越来越多. ...
- vba随机抽取人名不重复_excel筛选重复姓名 求出Excel中不重复的人的姓名的VBA代码...
excel筛选重复姓名 求出Excel中不重复的人的姓名的VBA代码,看到标题你是不是很兴奋,这不就是你想学习的知识吗?当你掌握excel筛选重复姓名这个知识的时候你一定很兴奋,一定不会后悔看了exc ...
- iframe视频代码_在Excel中创建IFRAME代码
iframe视频代码 If you want to embed a YouTube video on your website, YouTube will create some IFRAME cod ...
- latex附录中放python代码_在Latex中插入Python代码
这里指的插入是指最终能在生成的pdf中显示高亮的Python代码. 在Latex中插入Python代码,需要一个第三发的宏包pythonhighlight: https://github.com/ol ...
- Java实例-查找数组中的重复元素
代码实现 public class MainClass {public static void main(String[] args) {int[] my_array = {1, 2, 5, 5, 6 ...
最新文章
- 标题 相机标定(Camera calibration)原理和步骤
- cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp” 和 cl: 命令行 error D8021 :无效的数值参数“/Wno-unused-function”
- title: bat批处理简介:Windows自动化之道
- httpclient高频请求
- Dapper源码学习和源码修改
- 常系数线性递推的第n项及前n项和(转载)
- std::string的resize()与reserve()的区别
- 利用iTextSharp对PDF进行签名(E-signing PDF documents with iTextSharp)--推荐
- XML DOM Object Model in .NET [3/3] - Samples
- 设计模式(4):生成器模式(Builder)
- JMeter下载及安装详细教程
- ssm基于J2EE的办公用品管理系统
- 下载 沙耶之歌Android_沙耶之歌安卓版
- matplotlib画柱状图
- Python数据有效性DataValidation模块
- pip 安装包成功 但是import 失败
- 【中土世界】萨鲁曼小传
- 独立同分布(I.I.D.)是什么?(转载)
- python dis模块解析
- linux bash环境下面给expect脚本传递参数