首页 > 其他 > 详细

CodeReview of JDK Source Code

时间:2014-03-18 11:52:37      阅读:507      评论:0      收藏:0      [点我收藏+]

jdk1.6.0_35/src.zip, only java package is reviewd(full package review caused a OutofMemory on java heap size).

Checkstyle Review

tyRules.xml:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

Run code review

java -jar checkstyle-5.6-all.jar -c tyRules.xml -r /home/chad/tmp/jdksrc -o result.txt

Get Review Result

grep "Method length is" result.txt|wc -l

grep "Nested if-else depth is" result.txt|wc -l

grep "More than 6 parameters" result.txt|wc -l

grep "max allowed is 1,000" result.txt|wc -l

grep "Found duplicate of" result.txt|wc -l

grep "Cyclomatic Complexity is" result.txt|wc -l

Sonar Review

sonar-project.properties:

sonar.projectKey=jdk.sonar.analysis sonar.projectName=JDK sonar.projectVersion=1.6 sonar.sources=jdksrc sonar.login=liuyan sonar.password=liuyan sonar.language=java sonar.profile=TongYong sonar.skipDesign=true sonar.dynamicAnalysis=false

Run code review

/opt/sonar-server/runner/sonar-runner-2.2/bin/sonar-runner

The profile TongYong is imported from above tyRules.xml.

Result

From Sonar

Lines of code: 202,505 (NBNC, not blank not comment code lines);

559,577 lines (total lines = NBNC + blank + comment);

Above can be verified by cloc.

2172 Classes, 21,275 methods, 675 method cyclomatic complexity are greater than 10,

Cyclomatic Complxity

GCP: 298/6276 = 4.75%

JDK: 674/21275 = 3.17%

Duplicate Lines

GCP:

JDK: 825/

CodeReview of JDK Source Code,布布扣,bubuko.com

CodeReview of JDK Source Code

原文:http://www.cnblogs.com/darkmatter/p/3606756.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!