zoukankan      html  css  js  c++  java
  • CodeReview of JDK Source Code

    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/

  • 相关阅读:
    115. Distinct Subsequences
    91. Decode Ways
    72. Edit Distance
    python 输出 a+b
    求次小生成树
    判断最小生成树是否唯一
    二分法求最优值
    黑科技
    线段树+ 区间更新
    2018ICPC青岛赛区J题
  • 原文地址:https://www.cnblogs.com/darkmatter/p/3606756.html
Copyright © 2011-2022 走看看