package brilliance.znjt.eurekaproducer;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import org.aspectj.weaver.ast.And;
/**
* **********************************************
* @description 计算源代码(src)行数,不计算空行
* 宗旨:将src下所有文件组装成list,再筛选出文件,对文件进行遍历读取
* @version 1.0
***********************************************
*/
public class LineCounter {
List<File> list = new ArrayList<File>();
int linenumber = 0;
FileReader fr = null;
BufferedReader br = null;
public void counter(String projectName) {
int totalNum = 0;
// String path = System.getProperty("user.dir");
String path = LineCounter.class.getResource("/").getPath(); // 同下个path
path = path.substring(0, path.length() - 21) /*+ projectName */
代码行数计算器
最新推荐文章于 2024-06-06 10:14:56 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)