CodeReview of JDK Source Code
2014-03-18 08:04
225 查看
jdk1.6.0_35/src.zip, only java package is reviewd(full package review caused a OutofMemory on java heap size).
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
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.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
The profile TongYong is imported from above tyRules.xml.
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,
JDK: 674/21275 = 3.17%
JDK: 825/
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.txtGet Review Result
grep "Method length is" result.txt|wc -lgrep "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.analysissonar.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-runnerThe 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/
相关文章推荐
- 3 Ways of JDK Source Code Attachment in Eclipse---reference
- 3 Ways of JDK Source Code Attachment in Eclipse
- Review of Codeforces 6B and 6C
- Review of codeforces 492C Vanya and Computer Game based on Python
- how to compile source code of "Data Structures & Algorithm Analysis in Java" writen by Mark Allen Weiss
- Ubuntu 16.04 compile JDK source code
- Review of codeforces 493B Vasya and Wrestling based on Python
- Source Code of Java - String
- source code of MES Data
- Source Code of Java - StringBuffer
- How to Get Source Code of a Linux Command on CentOS
- how to read source code of angular?
- warning: no rule to process file 'h' of type sourcecode.c.h for architecture i386
- The Logbook of Qt Source Code Reading(1)
- FTP Send File: Source Code Review(转)
- Source Code of Java - Boolean
- Some questions about source code of linux - 2014.01.20
- Source Code of Sonar Treasure Hunt
- Source Code of Java - Integer
- why separate the source code of a codec into two p