What are the guidelines for implementing Java Checkstyle checks? -


i newbie static code analysis tools java checkstyle. downloaded checkstyle package , see 2 sets of checks:

  • checkstyle_checks.xml
  • sun_checks.xml.

i compared these , geosoft_checks.xml master list of available in checkstyle...essentially 4 table full outer join see checks included in of 3 sources.

checks |source
-----------|--------------------------------------------------------
134.......| all available
75.........| checkstyle_checks.xml (plus suppressionfilter pointing suppressions.xml)
63.........| sun_checks.xml
73.........| geosoft_chekcs.xml (after removing 4 don't work in checkstyle 5.7)

  • doublecheckedlocking
  • packagehtml
  • tabcharacter
  • genericillegalregexp

i've done analysis on sun_checks , geosoft_checks determine ones can safely remove based on actual findings in code base (of course can come along , violate 1 of many checks not included in either)

are there recent guidelines checks include won't unnecessarily frustrate development team ? have people extended checkstyle useful checks have been contributed opensource community ?

this excellent question, , 1 warrants answer longer simple post. let me still try.

first off, there no accepted general guideline you. comes such guideline in fact marketing own stuff. so, firmly believe there nothing take , activate , done. kind of sad, there are.

the sun_checks historical, , have focus on formatting , naming. still best start, if have nothing else. checkstyle_checks checkstyle team uses check own code. don't know geosoft_checks, appear well-documented form of local guideline. there google java style, has become quite popular, afaik has no corresponding checkstyle ruleset yet.

checkstyle tool can more check style of java code. showed there twice many checks available being used rulesets. own ruleset uses 99 checks, highly tailored solution building.

as things stand, believe if static code analysis seriously, 1 day have go through list of available checks , put own ruleset. , add project goes on in order cover more , more cases you've identified potential bugs in solution building. fine-tuning , adding checkstyle profile ongoing task (of, say, hour per week).

if want avoid "unnecessarily frustrating development team", important aspect clear, well-documented, , consistent rules. also, integrate checkstyle nightly build and/or version control system.

the prominent checkstyle extensions sevntu checkstyle , checkstyle addons. lead guy of sevntu checkstyle main committer of checkstyle today, maybe 2 merge time in future.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -