@boyingliu01/xp-gate 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/adapters/java.sh +1 -1
  2. package/adapters/plugins/book299-20132-python/README.md +21 -0
  3. package/adapters/plugins/book299-20132-python/plugin.yml +21 -0
  4. package/adapters/plugins/book299-20132-python/rules/exception/gen-0023.yml +14 -0
  5. package/adapters/plugins/book299-20132-python/rules/logging/gen-0071.yml +14 -0
  6. package/adapters/plugins/book299-20132-python/rules/style/gen-0001.yml +14 -0
  7. package/adapters/plugins/book299-20132-python/rules/style/gen-0002.yml +14 -0
  8. package/adapters/plugins/book299-20132-python/rules/style/gen-0003.yml +14 -0
  9. package/adapters/plugins/book299-20132-python/rules/style/gen-0004.yml +14 -0
  10. package/adapters/plugins/book299-20132-python/rules/style/gen-0005.yml +14 -0
  11. package/adapters/plugins/book299-20132-python/rules/style/gen-0006.yml +14 -0
  12. package/adapters/plugins/book299-20132-python/rules/style/gen-0007.yml +14 -0
  13. package/adapters/plugins/book299-20132-python/rules/style/gen-0008.yml +14 -0
  14. package/adapters/plugins/book299-20132-python/rules/style/gen-0009.yml +14 -0
  15. package/adapters/plugins/book299-20132-python/rules/style/gen-0010.yml +14 -0
  16. package/adapters/plugins/book299-20132-python/rules/style/gen-0011.yml +14 -0
  17. package/adapters/plugins/book299-20132-python/rules/style/gen-0012.yml +14 -0
  18. package/adapters/plugins/book299-20132-python/rules/style/gen-0013.yml +14 -0
  19. package/adapters/plugins/book299-20132-python/rules/style/gen-0014.yml +14 -0
  20. package/adapters/plugins/book299-20132-python/rules/style/gen-0015.yml +14 -0
  21. package/adapters/plugins/book299-20132-python/rules/style/gen-0016.yml +14 -0
  22. package/adapters/plugins/book299-20132-python/rules/style/gen-0017.yml +14 -0
  23. package/adapters/plugins/book299-20132-python/rules/style/gen-0018.yml +14 -0
  24. package/adapters/plugins/book299-20132-python/rules/style/gen-0019.yml +14 -0
  25. package/adapters/plugins/book299-20132-python/rules/style/gen-0020.yml +14 -0
  26. package/adapters/plugins/book299-20132-python/rules/style/gen-0021.yml +14 -0
  27. package/adapters/plugins/book299-20132-python/rules/style/gen-0022.yml +14 -0
  28. package/adapters/plugins/book299-20132-python/rules/style/gen-0024.yml +14 -0
  29. package/adapters/plugins/book299-20132-python/rules/style/gen-0025.yml +14 -0
  30. package/adapters/plugins/book299-20132-python/rules/style/gen-0026.yml +14 -0
  31. package/adapters/plugins/book299-20132-python/rules/style/gen-0027.yml +14 -0
  32. package/adapters/plugins/book299-20132-python/rules/style/gen-0028.yml +14 -0
  33. package/adapters/plugins/book299-20132-python/rules/style/gen-0029.yml +14 -0
  34. package/adapters/plugins/book299-20132-python/rules/style/gen-0030.yml +14 -0
  35. package/adapters/plugins/book299-20132-python/rules/style/gen-0031.yml +14 -0
  36. package/adapters/plugins/book299-20132-python/rules/style/gen-0032.yml +14 -0
  37. package/adapters/plugins/book299-20132-python/rules/style/gen-0033.yml +14 -0
  38. package/adapters/plugins/book299-20132-python/rules/style/gen-0034.yml +14 -0
  39. package/adapters/plugins/book299-20132-python/rules/style/gen-0035.yml +14 -0
  40. package/adapters/plugins/book299-20132-python/rules/style/gen-0036.yml +14 -0
  41. package/adapters/plugins/book299-20132-python/rules/style/gen-0037.yml +14 -0
  42. package/adapters/plugins/book299-20132-python/rules/style/gen-0038.yml +14 -0
  43. package/adapters/plugins/book299-20132-python/rules/style/gen-0039.yml +14 -0
  44. package/adapters/plugins/book299-20132-python/rules/style/gen-0040.yml +14 -0
  45. package/adapters/plugins/book299-20132-python/rules/style/gen-0041.yml +14 -0
  46. package/adapters/plugins/book299-20132-python/rules/style/gen-0042.yml +14 -0
  47. package/adapters/plugins/book299-20132-python/rules/style/gen-0043.yml +14 -0
  48. package/adapters/plugins/book299-20132-python/rules/style/gen-0044.yml +14 -0
  49. package/adapters/plugins/book299-20132-python/rules/style/gen-0045.yml +14 -0
  50. package/adapters/plugins/book299-20132-python/rules/style/gen-0046.yml +14 -0
  51. package/adapters/plugins/book299-20132-python/rules/style/gen-0047.yml +14 -0
  52. package/adapters/plugins/book299-20132-python/rules/style/gen-0048.yml +14 -0
  53. package/adapters/plugins/book299-20132-python/rules/style/gen-0049.yml +14 -0
  54. package/adapters/plugins/book299-20132-python/rules/style/gen-0050.yml +14 -0
  55. package/adapters/plugins/book299-20132-python/rules/style/gen-0051.yml +14 -0
  56. package/adapters/plugins/book299-20132-python/rules/style/gen-0052.yml +14 -0
  57. package/adapters/plugins/book299-20132-python/rules/style/gen-0053.yml +14 -0
  58. package/adapters/plugins/book299-20132-python/rules/style/gen-0054.yml +14 -0
  59. package/adapters/plugins/book299-20132-python/rules/style/gen-0055.yml +14 -0
  60. package/adapters/plugins/book299-20132-python/rules/style/gen-0056.yml +14 -0
  61. package/adapters/plugins/book299-20132-python/rules/style/gen-0057.yml +14 -0
  62. package/adapters/plugins/book299-20132-python/rules/style/gen-0058.yml +14 -0
  63. package/adapters/plugins/book299-20132-python/rules/style/gen-0059.yml +14 -0
  64. package/adapters/plugins/book299-20132-python/rules/style/gen-0060.yml +14 -0
  65. package/adapters/plugins/book299-20132-python/rules/style/gen-0061.yml +14 -0
  66. package/adapters/plugins/book299-20132-python/rules/style/gen-0062.yml +14 -0
  67. package/adapters/plugins/book299-20132-python/rules/style/gen-0063.yml +14 -0
  68. package/adapters/plugins/book299-20132-python/rules/style/gen-0064.yml +14 -0
  69. package/adapters/plugins/book299-20132-python/rules/style/gen-0065.yml +14 -0
  70. package/adapters/plugins/book299-20132-python/rules/style/gen-0066.yml +14 -0
  71. package/adapters/plugins/book299-20132-python/rules/style/gen-0067.yml +14 -0
  72. package/adapters/plugins/book299-20132-python/rules/style/gen-0068.yml +14 -0
  73. package/adapters/plugins/book299-20132-python/rules/style/gen-0069.yml +14 -0
  74. package/adapters/plugins/book299-20132-python/rules/style/gen-0070.yml +14 -0
  75. package/adapters/plugins/book299-20132-python/rules/style/gen-0072.yml +14 -0
  76. package/adapters/plugins/book299-20132-python/rules/style/gen-0073.yml +14 -0
  77. package/adapters/plugins/book299-20132-python/scripts/install-gradle.sh +4 -0
  78. package/adapters/plugins/book299-20132-python/scripts/install-maven.sh +20 -0
  79. package/adapters/plugins/book299-4081-c/README.md +21 -0
  80. package/adapters/plugins/book299-4081-c/plugin.yml +21 -0
  81. package/adapters/plugins/book299-4081-c/rules/collection/c/345/273/272-5-12.yml +14 -0
  82. package/adapters/plugins/book299-4081-c/rules/collection/c/345/273/272-5-8.yml +14 -0
  83. package/adapters/plugins/book299-4081-c/rules/concurrency/c/350/247/204-4-19.yml +14 -0
  84. package/adapters/plugins/book299-4081-c/rules/concurrency/c/350/247/204-4-20.yml +14 -0
  85. package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-11.yml +14 -0
  86. package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-12.yml +14 -0
  87. package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-6.yml +14 -0
  88. package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-8.yml +14 -0
  89. package/adapters/plugins/book299-4081-c/rules/exception/c/350/247/204-4-9.yml +14 -0
  90. package/adapters/plugins/book299-4081-c/rules/performance/c/345/273/272-5-13.yml +14 -0
  91. package/adapters/plugins/book299-4081-c/rules/performance/c/345/273/272-5-6.yml +14 -0
  92. package/adapters/plugins/book299-4081-c/rules/performance/c/345/273/272-5-7.yml +14 -0
  93. package/adapters/plugins/book299-4081-c/rules/performance/c/350/247/204-4-14.yml +14 -0
  94. package/adapters/plugins/book299-4081-c/rules/performance/c/350/247/204-4-2.yml +14 -0
  95. package/adapters/plugins/book299-4081-c/rules/resource/c/345/273/272-4-2.yml +14 -0
  96. package/adapters/plugins/book299-4081-c/rules/security/c/350/247/204-4-13.yml +14 -0
  97. package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-1.yml +14 -0
  98. package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-2.yml +14 -0
  99. package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-3.yml +14 -0
  100. package/adapters/plugins/book299-4081-c/rules/style/c/345/216/237-1-4.yml +14 -0
  101. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-1.yml +14 -0
  102. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-2.yml +14 -0
  103. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-3.yml +14 -0
  104. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-2-4.yml +14 -0
  105. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-1.yml +14 -0
  106. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-2.yml +14 -0
  107. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-3.yml +14 -0
  108. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-4.yml +14 -0
  109. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-5.yml +14 -0
  110. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-6.yml +14 -0
  111. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-7.yml +14 -0
  112. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-3-8.yml +14 -0
  113. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-4-1.yml +14 -0
  114. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-4-3.yml +14 -0
  115. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-1.yml +14 -0
  116. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-10.yml +14 -0
  117. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-11.yml +14 -0
  118. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-2.yml +14 -0
  119. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-3.yml +14 -0
  120. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-4.yml +14 -0
  121. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-5.yml +14 -0
  122. package/adapters/plugins/book299-4081-c/rules/style/c/345/273/272-5-9.yml +14 -0
  123. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-1.yml +14 -0
  124. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-10.yml +14 -0
  125. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-11.yml +14 -0
  126. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-12.yml +14 -0
  127. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-13.yml +14 -0
  128. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-14.yml +14 -0
  129. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-16.yml +14 -0
  130. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-17.yml +14 -0
  131. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-18.yml +14 -0
  132. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-19.yml +14 -0
  133. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-2.yml +14 -0
  134. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-20.yml +14 -0
  135. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-3.yml +14 -0
  136. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-4.yml +14 -0
  137. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-5.yml +14 -0
  138. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-6.yml +14 -0
  139. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-7.yml +14 -0
  140. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-8.yml +14 -0
  141. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-2-9.yml +14 -0
  142. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-1.yml +14 -0
  143. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-10.yml +14 -0
  144. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-11.yml +14 -0
  145. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-12.yml +14 -0
  146. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-13.yml +14 -0
  147. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-14.yml +14 -0
  148. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-15.yml +14 -0
  149. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-16.yml +14 -0
  150. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-17.yml +14 -0
  151. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-18.yml +14 -0
  152. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-19.yml +14 -0
  153. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-2.yml +14 -0
  154. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-20.yml +14 -0
  155. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-21.yml +14 -0
  156. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-22.yml +14 -0
  157. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-3.yml +14 -0
  158. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-4.yml +14 -0
  159. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-5.yml +14 -0
  160. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-6.yml +14 -0
  161. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-7.yml +14 -0
  162. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-8.yml +14 -0
  163. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-3-9.yml +14 -0
  164. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-1.yml +14 -0
  165. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-10.yml +14 -0
  166. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-15.yml +14 -0
  167. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-16.yml +14 -0
  168. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-17.yml +14 -0
  169. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-18.yml +14 -0
  170. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-3.yml +14 -0
  171. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-4.yml +14 -0
  172. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-5.yml +14 -0
  173. package/adapters/plugins/book299-4081-c/rules/style/c/350/247/204-4-7.yml +14 -0
  174. package/adapters/plugins/book299-4081-c/scripts/install-gradle.sh +4 -0
  175. package/adapters/plugins/book299-4081-c/scripts/install-maven.sh +20 -0
  176. package/adapters/plugins/book299-4083-javascriptes5/README.md +21 -0
  177. package/adapters/plugins/book299-4083-javascriptes5/plugin.yml +21 -0
  178. package/adapters/plugins/book299-4083-javascriptes5/rules/security/gen-0001.yml +14 -0
  179. package/adapters/plugins/book299-4083-javascriptes5/rules/security/gen-0002.yml +14 -0
  180. package/adapters/plugins/book299-4083-javascriptes5/rules/security/gen-0003.yml +14 -0
  181. package/adapters/plugins/book299-4083-javascriptes5/scripts/install-gradle.sh +4 -0
  182. package/adapters/plugins/book299-4083-javascriptes5/scripts/install-maven.sh +20 -0
  183. package/adapters/plugins/p3c-java/README.md +66 -0
  184. package/adapters/plugins/p3c-java/plugin.yml +30 -0
  185. package/adapters/plugins/p3c-java/scripts/install-gradle-p3c.sh +45 -0
  186. package/adapters/plugins/p3c-java/scripts/install-maven-p3c.sh +98 -0
  187. package/adapters/plugins/p3c-java/templates/gradle/xp-gate-p3c-gradle.gradle +68 -0
  188. package/adapters/plugins/p3c-java/templates/maven/xp-gate-p3c-profile.xml +81 -0
  189. package/adapters/plugins/whalecloud-java/README.md +98 -0
  190. package/adapters/plugins/whalecloud-java/plugin.yml +45 -0
  191. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-001.yml +17 -0
  192. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-002.yml +17 -0
  193. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-003.yml +17 -0
  194. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-004.yml +17 -0
  195. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-005.yml +17 -0
  196. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-006.yml +17 -0
  197. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-007.yml +17 -0
  198. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-008.yml +17 -0
  199. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-009.yml +17 -0
  200. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-010.yml +17 -0
  201. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-011.yml +17 -0
  202. package/adapters/plugins/whalecloud-java/rules/collection/wc-collect-012.yml +17 -0
  203. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-001.yml +17 -0
  204. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-002.yml +17 -0
  205. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-003.yml +17 -0
  206. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-004.yml +17 -0
  207. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-005.yml +17 -0
  208. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-006.yml +17 -0
  209. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-007.yml +17 -0
  210. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-008.yml +17 -0
  211. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-009.yml +17 -0
  212. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-010.yml +17 -0
  213. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-011.yml +17 -0
  214. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-012.yml +17 -0
  215. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-013.yml +17 -0
  216. package/adapters/plugins/whalecloud-java/rules/concurrency/wc-concur-014.yml +17 -0
  217. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-001.yml +17 -0
  218. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-002.yml +17 -0
  219. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-003.yml +17 -0
  220. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-004.yml +17 -0
  221. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-005.yml +17 -0
  222. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-006.yml +17 -0
  223. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-007.yml +17 -0
  224. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-008.yml +17 -0
  225. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-009.yml +17 -0
  226. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-010.yml +17 -0
  227. package/adapters/plugins/whalecloud-java/rules/exception/wc-except-011.yml +17 -0
  228. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-001.yml +17 -0
  229. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-002.yml +17 -0
  230. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-003.yml +17 -0
  231. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-004.yml +17 -0
  232. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-005.yml +17 -0
  233. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-006.yml +17 -0
  234. package/adapters/plugins/whalecloud-java/rules/logging/wc-log-007.yml +17 -0
  235. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-001.yml +17 -0
  236. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-002.yml +17 -0
  237. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-003.yml +17 -0
  238. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-004.yml +17 -0
  239. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-005.yml +17 -0
  240. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-006.yml +17 -0
  241. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-007.yml +17 -0
  242. package/adapters/plugins/whalecloud-java/rules/performance/wc-perf-008.yml +17 -0
  243. package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-001.yml +17 -0
  244. package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-002.yml +17 -0
  245. package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-003.yml +17 -0
  246. package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-004.yml +17 -0
  247. package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-005.yml +17 -0
  248. package/adapters/plugins/whalecloud-java/rules/resource/wc-reso-006.yml +17 -0
  249. package/adapters/plugins/whalecloud-java/rules/security/wc-secu-001.yml +17 -0
  250. package/adapters/plugins/whalecloud-java/rules/security/wc-secu-002.yml +17 -0
  251. package/adapters/plugins/whalecloud-java/rules/security/wc-secu-003.yml +17 -0
  252. package/adapters/plugins/whalecloud-java/rules/security/wc-secu-004.yml +17 -0
  253. package/adapters/plugins/whalecloud-java/rules/security/wc-secu-005.yml +17 -0
  254. package/adapters/plugins/whalecloud-java/rules/style/wc-style-001.yml +17 -0
  255. package/adapters/plugins/whalecloud-java/rules/style/wc-style-002.yml +17 -0
  256. package/adapters/plugins/whalecloud-java/rules/style/wc-style-003.yml +17 -0
  257. package/adapters/plugins/whalecloud-java/rules/style/wc-style-004.yml +17 -0
  258. package/adapters/plugins/whalecloud-java/rules/style/wc-style-005.yml +17 -0
  259. package/adapters/plugins/whalecloud-java/rules/style/wc-style-006.yml +17 -0
  260. package/adapters/plugins/whalecloud-java/rules/style/wc-style-007.yml +17 -0
  261. package/adapters/plugins/whalecloud-java/rules/style/wc-style-008.yml +17 -0
  262. package/adapters/plugins/whalecloud-java/rules/style/wc-style-009.yml +17 -0
  263. package/adapters/plugins/whalecloud-java/rules/style/wc-style-010.yml +17 -0
  264. package/adapters/plugins/whalecloud-java/rules/style/wc-style-011.yml +17 -0
  265. package/adapters/plugins/whalecloud-java/rules/style/wc-style-012.yml +17 -0
  266. package/adapters/plugins/whalecloud-java/rules/style/wc-style-013.yml +17 -0
  267. package/adapters/plugins/whalecloud-java/rules/style/wc-style-014.yml +17 -0
  268. package/adapters/plugins/whalecloud-java/rules/style/wc-style-015.yml +17 -0
  269. package/adapters/plugins/whalecloud-java/rules/style/wc-style-016.yml +17 -0
  270. package/adapters/plugins/whalecloud-java/rules/style/wc-style-017.yml +17 -0
  271. package/adapters/plugins/whalecloud-java/rules/style/wc-style-018.yml +17 -0
  272. package/adapters/plugins/whalecloud-java/scripts/install-gradle-whalecloud.sh +97 -0
  273. package/adapters/plugins/whalecloud-java/scripts/install-maven-whalecloud.sh +201 -0
  274. package/adapters/plugins/whalecloud-java/templates/gradle/xp-gate-whalecloud-gradle.gradle +73 -0
  275. package/adapters/plugins/whalecloud-java/templates/maven/xp-gate-whalecloud-profile.xml +148 -0
  276. package/hooks/pre-commit +26 -23
  277. package/hooks/pre-push +7 -3
  278. package/lib/__tests__/ui-detector.test.ts +94 -0
  279. package/lib/init.js +44 -0
  280. package/lib/ui-detector.ts +3 -3
  281. package/package.json +1 -1
  282. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  283. package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
  284. package/plugins/claude-code/skills/ralph-loop/SKILL.md +41 -3
  285. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
  286. package/plugins/claude-code/skills/sprint-flow/SKILL.md +147 -4
  287. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
  288. package/plugins/opencode/package.json +1 -1
  289. package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
  290. package/plugins/opencode/skills/ralph-loop/SKILL.md +41 -3
  291. package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
  292. package/plugins/opencode/skills/sprint-flow/SKILL.md +147 -4
  293. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
  294. package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
  295. package/plugins/qoder/skills/ralph-loop/SKILL.md +41 -3
  296. package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
  297. package/plugins/qoder/skills/sprint-flow/SKILL.md +147 -4
  298. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
  299. package/skills/delphi-review/AGENTS.md +1 -1
  300. package/skills/ralph-loop/SKILL.md +41 -3
  301. package/skills/sprint-flow/AGENTS.md +1 -1
  302. package/skills/sprint-flow/SKILL.md +147 -4
  303. package/skills/test-specification-alignment/AGENTS.md +1 -1
@@ -0,0 +1,98 @@
1
+ # whalecloud-java — 浩鲸科技 Java 编码规范增强插件
2
+
3
+ 浩鲸 Java 规范以阿里 p3c-pmd 规范为基础,但增加了企业内部积累的经验规则和安全规范。
4
+
5
+ ## 规则覆盖
6
+
7
+ 106 条规则(74 强制 + 32 推荐),在 p3c-pmd 54 条基线规则之上叠加:
8
+
9
+ | 类别 | 规则数 | 内容 |
10
+ |------|--------|------|
11
+ | wc-collection | 12 | 集合处理增强 — subList/addAll/asList/map 视图等 p3c 未覆盖的陷阱 |
12
+ | wc-concurrent | 14 | 并发编程增强 — 锁策略/双重检查锁/HashMap 死循环等 |
13
+ | wc-exception | 11 | 异常处理规范 — 异常分类处理/finally 规范/异常匹配 |
14
+ | wc-logging | 7 | 日志输出规范 — 占位符/级别判断/重复打印/国际化 |
15
+ | wc-security | 10 | 安全管理规范 — SQL 注入/MD5/HTTP 超时/HttpClient |
16
+ | wc-resource | 6 | 资源管理规范 — 资源关闭/finally-return/静态块 |
17
+ | wc-style | 18 | 编码风格规范 — 访问控制/赋值语句/类型转换/POJO/序列化 |
18
+ | wc-performance | 8 | 性能优化规范 — 字符串连接/正则预编译/I/O 缓冲 |
19
+ | wc-security-chapter | 10+ | 安全篇 — SQL/XML/日志/命令注入,路径标准化,Zip 炸弹防护 |
20
+
21
+ ## 与 p3c-pmd 关系
22
+
23
+ ```
24
+ ┌─────────────────────────────────────────┐
25
+ │ xp-gate-pre-commit │
26
+ │ Gate 1 │
27
+ ├─────────────────────────────────────────┤
28
+ │ whalecloud-java (106 条) │
29
+ │ ┌─────────────────────────────────┐ │
30
+ │ │ 浩鲸增强层 (74+32 条自定义) │ │
31
+ │ └─────────────────────────────────┘ │
32
+ │ ┌─────────────────────────────────┐ │
33
+ │ │ p3c-pmd 基线 (54 条阿里规则) │ │
34
+ │ └─────────────────────────────────┘ │
35
+ └─────────────────────────────────────────┘
36
+ ```
37
+
38
+ p3c-pmd 是**必要不充分条件**。启用 whalecloud-java 自动包含 p3c-pmd。
39
+
40
+ ## 安装
41
+
42
+ ### Maven
43
+
44
+ ```bash
45
+ bash githooks/adapters/plugins/whalecloud-java/scripts/install-maven-whalecloud.sh
46
+ ```
47
+
48
+ ### Gradle
49
+
50
+ ```bash
51
+ bash githooks/adapters/plugins/whalecloud-java/scripts/install-gradle-whalecloud.sh
52
+ ```
53
+
54
+ ## 手动运行
55
+
56
+ ```bash
57
+ # Maven
58
+ mvn clean verify -P xp-gate-whalecloud-java
59
+
60
+ # 同时运行 p3c-pmd + whalecloud(推荐)
61
+ mvn clean verify -P xp-gate-p3c,xp-gate-whalecloud-java
62
+
63
+ # Gradle
64
+ ./gradlew xp-gateWhalecloudCheck
65
+ ```
66
+
67
+ ## 检查工具链
68
+
69
+ | 工具 | 版本 | 用途 |
70
+ |------|------|------|
71
+ | PMD | 7.7.0 | 静态分析 + 自定义规则集 |
72
+ | CheckStyle | 10.21.3 | 代码风格检查 |
73
+ | SpotBugs | 4.7.3 | 字节码分析 + 安全检测 |
74
+ | FindSecBugs | 1.12.0 | 安全漏洞扫描 |
75
+ | Lizard | 1.17.10 | 圈复杂度检测 |
76
+
77
+ ## 插件结构
78
+
79
+ ```
80
+ whalecloud-java/
81
+ ├── plugin.yml # 插件元数据
82
+ ├── README.md # 说明文档
83
+ ├── rules/ # 规则定义目录
84
+ │ ├── collection/ # 集合处理规则
85
+ │ ├── concurrency/ # 并发编程规则
86
+ │ ├── exception/ # 异常处理规则
87
+ │ ├── logging/ # 日志规范规则
88
+ │ ├── security/ # 安全管理规则
89
+ │ ├── resource/ # 资源管理规则
90
+ │ ├── style/ # 编码风格规则
91
+ │ └── performance/ # 性能优化规则
92
+ ├── templates/
93
+ │ ├── maven/ # Maven profile 模板
94
+ │ └── gradle/ # Gradle 配置模板
95
+ └── scripts/
96
+ ├── install-maven-whalecloud.sh
97
+ └── install-gradle-whalecloud.sh
98
+ ```
@@ -0,0 +1,45 @@
1
+ ---
2
+ id: whalecloud-java
3
+ name: WhaleCloud Java Coding Standards
4
+ version: 1.0.0
5
+ languages: [java]
6
+ description: >
7
+ 浩鲸科技 Java 编码规范增强插件。在 p3c-pmd (Aribaba) 54 条规则基线之上,
8
+ 叠加 74 条浩鲸企业内部强制规则 + 32 条推荐规则 + 安全篇规范。
9
+ 覆盖集合处理、并发编程、异常处理、日志规范、安全管理、资源管理、编码风格、性能优化 8 大类别。
10
+ author: WhaleCloud Technology (浩鲸科技)
11
+ depends_on:
12
+ - id: p3c-java
13
+ version: ">=2.1.1"
14
+ required: true
15
+ reason: "p3c-pmd 提供 54 条 Alibaba 规范作为基线"
16
+ rules_count: 106 # 74 mandatory + 32 recommended
17
+ rules_count_by_severity:
18
+ error: 74 # 强制
19
+ warning: 32 # 推荐
20
+ categories:
21
+ # === 集合处理 (Collections) ===
22
+ - wc-collection: 集合处理增强 (12 条) — subList/addAll/asList/map视图等 p3c 未覆盖的陷阱
23
+ # === 并发编程 (Concurrency) ===
24
+ - wc-concurrent: 并发编程增强 (14 条) — 锁策略/双重检查锁/HashMap死循环/p3c未覆盖的同步陷阱
25
+ # === 异常处理 (Exception Handling) ===
26
+ - wc-exception: 异常处理规范 (11 条) — 异常分类处理/finally规范/异常匹配/异常流程控制
27
+ # === 日志规范 (Logging) ===
28
+ - wc-logging: 日志输出规范 (7 条) — 占位符/级别判断/重复打印/国际化/生产环境debug
29
+ # === 安全管理 (Security) ===
30
+ - wc-security: 安全管理规范 (10 条) — SQL注入加密/MDF5/SQL注入/HTTP超时/HttpClient
31
+ # === 资源管理 (Resource Management) ===
32
+ - wc-resource: 资源管理规范 (6 条) — 资源关闭/finally-return/静态块/响应关闭
33
+ # === 编码风格 (Code Style) ===
34
+ - wc-style: 编码风格规范 (18 条) — 访问控制/赋值语句/类型转换/POJO/序列化
35
+ # === 性能优化 (Performance) ===
36
+ - wc-performance: 性能优化规范 (8 条) — 字符串连接/正则预编译/I/O缓冲/内存管理
37
+ # === 安全篇 (Security Chapter) ===
38
+ - wc-security-chapter: 安全开发规范 (安全篇) — SQL/XML/日志/命令注入, 路径标准化, Zip炸弹
39
+ maven:
40
+ profile: xp-gate-whalecloud-java
41
+ profile_file: templates/maven/xp-gate-whalecloud-profile.xml
42
+ install_script: scripts/install-maven-whalecloud.sh
43
+ gradle:
44
+ config_file: templates/gradle/xp-gate-whalecloud-gradle.gradle
45
+ install_script: scripts/install-gradle-whalecloud.sh
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-001
3
+ name: ArrayList subList结果不可强转成ArrayList
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000001
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ ArrayList subList结果不可强转成ArrayList
10
+
11
+ 对应浩鲸规范 J000001。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "pmd:ArrayListSubList already covers this; verify severity matches"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-002
3
+ name: Map keySet/values/entrySet返回集合不可添加元素
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000002
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ Map keySet/values/entrySet返回集合不可添加元素
10
+
11
+ 对应浩鲸规范 J000002。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "SpotBugs: COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-003
3
+ name: 不可对Collections返回的不可变列表进行添加或删除
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000003
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 不可对Collections返回的不可变列表进行添加或删除
10
+
11
+ 对应浩鲸规范 J000003。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "UnsupportedOperationException risk"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-004
3
+ name: subList场景中原集合元素增加或删除需高度注意
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000004
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ subList场景中原集合元素增加或删除需高度注意
10
+
11
+ 对应浩鲸规范 J000004。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "ConcurrentModificationException risk"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-005
3
+ name: 集合转数组必须使用toArray(T[] array)
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000005
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 集合转数组必须使用toArray(T[] array)
10
+
11
+ 对应浩鲸规范 J000005。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "toArray() without args loses type safety"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-006
3
+ name: Collection addAll时需对每个元素类型检查
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000006
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ Collection addAll时需对每个元素类型检查
10
+
11
+ 对应浩鲸规范 J000006。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Type safety in bulk operations"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-007
3
+ name: 无泛型集合赋值给泛型限制集合时需警惕
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000008
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 无泛型集合赋值给泛型限制集合时需警惕
10
+
11
+ 对应浩鲸规范 J000008。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Raw type assignment风险"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-008
3
+ name: 列表遍历循环里不可进行元素remove/add
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000009
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 列表遍历循环里不可进行元素remove/add
10
+
11
+ 对应浩鲸规范 J000009。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "ConcurrentModificationException"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-009
3
+ name: Map类集合K/V能存储null值的情况
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000011
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ Map类集合K/V能存储null值的情况
10
+
11
+ 对应浩鲸规范 J000011。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "HashMap vs ConcurrentHashMap null handling"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-010
3
+ name: 合理利用集合的有序性和稳定性
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J000012
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 合理利用集合的有序性和稳定性
10
+
11
+ 对应浩鲸规范 J000012。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "TreeSet vs HashSet selection"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-011
3
+ name: 集合初始化时指定初始值大小
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J0000117
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 集合初始化时指定初始值大小
10
+
11
+ 对应浩鲸规范 J0000117。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Avoid resize overhead"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-COLLECT-012
3
+ name: 使用entrySet遍历Map而非keySet
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J0000118
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-collection
8
+ description: |
9
+ 使用entrySet遍历Map而非keySet
10
+
11
+ 对应浩鲸规范 J0000118。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "PMD:KeySetOverEntrySet"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-001
3
+ name: 获取单例对象需保证线程安全
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000014
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 获取单例对象需保证线程安全
10
+
11
+ 对应浩鲸规范 J000014。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Singleton thread safety"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-002
3
+ name: 高并发时同步调用考虑锁性能损耗
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000018
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 高并发时同步调用考虑锁性能损耗
10
+
11
+ 对应浩鲸规范 J000018。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Lock contention impact"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-003
3
+ name: 多资源加锁需保持一致的加锁顺序
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000019
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 多资源加锁需保持一致的加锁顺序
10
+
11
+ 对应浩鲸规范 J000019。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Deadlock prevention"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-004
3
+ name: 并发修改同一记录需加锁
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000020
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 并发修改同一记录需加锁
10
+
11
+ 对应浩鲸规范 J000020。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Lost update prevention"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-005
3
+ name: 禁止使用Timer和TimerTask调度多任务
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000021
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 禁止使用Timer和TimerTask调度多任务
10
+
11
+ 对应浩鲸规范 J000021。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "PMD:AvoidUseTimer already covers"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-006
3
+ name: Lock类加锁需确保锁范围内代码受保护
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000022
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ Lock类加锁需确保锁范围内代码受保护
10
+
11
+ 对应浩鲸规范 J000022。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "try-finally pattern required"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-007
3
+ name: HashMap resize高并发可能死循环
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000023
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ HashMap resize高并发可能死循环
10
+
11
+ 对应浩鲸规范 J000023。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Use ConcurrentHashMap in JDK7-"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-008
3
+ name: 双重检查锁实现单例需volatile
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000026
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 双重检查锁实现单例需volatile
10
+
11
+ 对应浩鲸规范 J000026。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "PMD:NonVolatileClassMember"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-009
3
+ name: 多线程用线程安全集合
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000114
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 多线程用线程安全集合
10
+
11
+ 对应浩鲸规范 J000114。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "ConcurrentHashMap/CopyOnWriteArrayList"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-010
3
+ name: volatile解决内存可见性但无法解决原子性
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J000027
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ volatile解决内存可见性但无法解决原子性
10
+
11
+ 对应浩鲸规范 J000027。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "AtomicInteger over volatile int"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-011
3
+ name: 使用CountDownLatch进行异步转同步
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J000024
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 使用CountDownLatch进行异步转同步
10
+
11
+ 对应浩鲸规范 J000024。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "PMD:CountDownLatchUsage"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-012
3
+ name: 避免Random实例被多线程使用
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J000025
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 避免Random实例被多线程使用
10
+
11
+ 对应浩鲸规范 J000025。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "PMD:AvoidConcurrentCompetitionRandom"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-013
3
+ name: 不涉及多线程同步时用非线程安全集合
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J000114
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 不涉及多线程同步时用非线程安全集合
10
+
11
+ 对应浩鲸规范 J000114。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Performance optimization"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-CONCUR-014
3
+ name: 尽量减少不必要的synchronized
4
+ severity: warning # error=阻断, warning=警告
5
+ source: J000126
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-concurrency
8
+ description: |
9
+ 尽量减少不必要的synchronized
10
+
11
+ 对应浩鲸规范 J000126。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Lock contention reduction"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-EXCEPT-001
3
+ name: 可通过预检查规避的RuntimeException
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000039
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-exception
8
+ description: |
9
+ 可通过预检查规避的RuntimeException
10
+
11
+ 对应浩鲸规范 J000039。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Null check before method call"
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: WC-EXCEPT-002
3
+ name: 异常不能用做流程控制
4
+ severity: error # error=阻断, warning=警告
5
+ source: J000040
6
+ tool: auto # auto-manual-auto: detected by tool / manual check / AST-grep
7
+ category: wc-exception
8
+ description: |
9
+ 异常不能用做流程控制
10
+
11
+ 对应浩鲸规范 J000040。
12
+
13
+ check:
14
+ type: ast-grep # ast-grep / pmd-custom / spotbugs / checkstyle / manual
15
+ pattern: TODO
16
+
17
+ notes: "Exceptions for control flow anti-pattern"