@opensip-cli/checks-typescript 0.1.0

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 (404) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/all-checks-execute.test.d.ts +12 -0
  5. package/dist/__tests__/all-checks-execute.test.d.ts.map +1 -0
  6. package/dist/__tests__/all-checks-execute.test.js +846 -0
  7. package/dist/__tests__/all-checks-execute.test.js.map +1 -0
  8. package/dist/__tests__/behavior-fixtures-2.test.d.ts +9 -0
  9. package/dist/__tests__/behavior-fixtures-2.test.d.ts.map +1 -0
  10. package/dist/__tests__/behavior-fixtures-2.test.js +625 -0
  11. package/dist/__tests__/behavior-fixtures-2.test.js.map +1 -0
  12. package/dist/__tests__/behavior-fixtures-3.test.d.ts +7 -0
  13. package/dist/__tests__/behavior-fixtures-3.test.d.ts.map +1 -0
  14. package/dist/__tests__/behavior-fixtures-3.test.js +658 -0
  15. package/dist/__tests__/behavior-fixtures-3.test.js.map +1 -0
  16. package/dist/__tests__/behavior-fixtures-4.test.d.ts +8 -0
  17. package/dist/__tests__/behavior-fixtures-4.test.d.ts.map +1 -0
  18. package/dist/__tests__/behavior-fixtures-4.test.js +590 -0
  19. package/dist/__tests__/behavior-fixtures-4.test.js.map +1 -0
  20. package/dist/__tests__/behavior-fixtures-5.test.d.ts +7 -0
  21. package/dist/__tests__/behavior-fixtures-5.test.d.ts.map +1 -0
  22. package/dist/__tests__/behavior-fixtures-5.test.js +548 -0
  23. package/dist/__tests__/behavior-fixtures-5.test.js.map +1 -0
  24. package/dist/__tests__/behavior-fixtures-6.test.d.ts +18 -0
  25. package/dist/__tests__/behavior-fixtures-6.test.d.ts.map +1 -0
  26. package/dist/__tests__/behavior-fixtures-6.test.js +1700 -0
  27. package/dist/__tests__/behavior-fixtures-6.test.js.map +1 -0
  28. package/dist/__tests__/behavior-fixtures.test.d.ts +10 -0
  29. package/dist/__tests__/behavior-fixtures.test.d.ts.map +1 -0
  30. package/dist/__tests__/behavior-fixtures.test.js +812 -0
  31. package/dist/__tests__/behavior-fixtures.test.js.map +1 -0
  32. package/dist/__tests__/branch-fixtures-2.test.d.ts +6 -0
  33. package/dist/__tests__/branch-fixtures-2.test.d.ts.map +1 -0
  34. package/dist/__tests__/branch-fixtures-2.test.js +1369 -0
  35. package/dist/__tests__/branch-fixtures-2.test.js.map +1 -0
  36. package/dist/__tests__/branch-fixtures-3.test.d.ts +7 -0
  37. package/dist/__tests__/branch-fixtures-3.test.d.ts.map +1 -0
  38. package/dist/__tests__/branch-fixtures-3.test.js +877 -0
  39. package/dist/__tests__/branch-fixtures-3.test.js.map +1 -0
  40. package/dist/__tests__/branch-fixtures.test.d.ts +6 -0
  41. package/dist/__tests__/branch-fixtures.test.d.ts.map +1 -0
  42. package/dist/__tests__/branch-fixtures.test.js +1072 -0
  43. package/dist/__tests__/branch-fixtures.test.js.map +1 -0
  44. package/dist/__tests__/checks.test.d.ts +2 -0
  45. package/dist/__tests__/checks.test.d.ts.map +1 -0
  46. package/dist/__tests__/checks.test.js +39 -0
  47. package/dist/__tests__/checks.test.js.map +1 -0
  48. package/dist/__tests__/fixture-coverage.allowlist.d.ts +19 -0
  49. package/dist/__tests__/fixture-coverage.allowlist.d.ts.map +1 -0
  50. package/dist/__tests__/fixture-coverage.allowlist.js +27 -0
  51. package/dist/__tests__/fixture-coverage.allowlist.js.map +1 -0
  52. package/dist/__tests__/fixture-coverage.test.d.ts +13 -0
  53. package/dist/__tests__/fixture-coverage.test.d.ts.map +1 -0
  54. package/dist/__tests__/fixture-coverage.test.js +57 -0
  55. package/dist/__tests__/fixture-coverage.test.js.map +1 -0
  56. package/dist/__tests__/no-bootstrap-tool-import.test.d.ts +2 -0
  57. package/dist/__tests__/no-bootstrap-tool-import.test.d.ts.map +1 -0
  58. package/dist/__tests__/no-bootstrap-tool-import.test.js +75 -0
  59. package/dist/__tests__/no-bootstrap-tool-import.test.js.map +1 -0
  60. package/dist/__tests__/phantom-dependency-detection.test.d.ts +12 -0
  61. package/dist/__tests__/phantom-dependency-detection.test.d.ts.map +1 -0
  62. package/dist/__tests__/phantom-dependency-detection.test.js +112 -0
  63. package/dist/__tests__/phantom-dependency-detection.test.js.map +1 -0
  64. package/dist/__tests__/typescript-frontend.test.d.ts +8 -0
  65. package/dist/__tests__/typescript-frontend.test.d.ts.map +1 -0
  66. package/dist/__tests__/typescript-frontend.test.js +57 -0
  67. package/dist/__tests__/typescript-frontend.test.js.map +1 -0
  68. package/dist/checks/architecture/circular-import-detection.d.ts +14 -0
  69. package/dist/checks/architecture/circular-import-detection.d.ts.map +1 -0
  70. package/dist/checks/architecture/circular-import-detection.js +55 -0
  71. package/dist/checks/architecture/circular-import-detection.js.map +1 -0
  72. package/dist/checks/architecture/contracts-schema-consistency.d.ts +11 -0
  73. package/dist/checks/architecture/contracts-schema-consistency.d.ts.map +1 -0
  74. package/dist/checks/architecture/contracts-schema-consistency.js +75 -0
  75. package/dist/checks/architecture/contracts-schema-consistency.js.map +1 -0
  76. package/dist/checks/architecture/drizzle-orm-migration-guardrails.d.ts +12 -0
  77. package/dist/checks/architecture/drizzle-orm-migration-guardrails.d.ts.map +1 -0
  78. package/dist/checks/architecture/drizzle-orm-migration-guardrails.js +92 -0
  79. package/dist/checks/architecture/drizzle-orm-migration-guardrails.js.map +1 -0
  80. package/dist/checks/architecture/index.d.ts +10 -0
  81. package/dist/checks/architecture/index.d.ts.map +1 -0
  82. package/dist/checks/architecture/index.js +10 -0
  83. package/dist/checks/architecture/index.js.map +1 -0
  84. package/dist/checks/architecture/missing-type-exports.d.ts +13 -0
  85. package/dist/checks/architecture/missing-type-exports.d.ts.map +1 -0
  86. package/dist/checks/architecture/missing-type-exports.js +245 -0
  87. package/dist/checks/architecture/missing-type-exports.js.map +1 -0
  88. package/dist/checks/architecture/module-coupling-fan-out.d.ts +20 -0
  89. package/dist/checks/architecture/module-coupling-fan-out.d.ts.map +1 -0
  90. package/dist/checks/architecture/module-coupling-fan-out.js +120 -0
  91. package/dist/checks/architecture/module-coupling-fan-out.js.map +1 -0
  92. package/dist/checks/architecture/no-bootstrap-tool-import.d.ts +38 -0
  93. package/dist/checks/architecture/no-bootstrap-tool-import.d.ts.map +1 -0
  94. package/dist/checks/architecture/no-bootstrap-tool-import.js +95 -0
  95. package/dist/checks/architecture/no-bootstrap-tool-import.js.map +1 -0
  96. package/dist/checks/architecture/package-json-exports-field.d.ts +10 -0
  97. package/dist/checks/architecture/package-json-exports-field.d.ts.map +1 -0
  98. package/dist/checks/architecture/package-json-exports-field.js +56 -0
  99. package/dist/checks/architecture/package-json-exports-field.js.map +1 -0
  100. package/dist/checks/architecture/phantom-dependency-detection.d.ts +22 -0
  101. package/dist/checks/architecture/phantom-dependency-detection.d.ts.map +1 -0
  102. package/dist/checks/architecture/phantom-dependency-detection.js +330 -0
  103. package/dist/checks/architecture/phantom-dependency-detection.js.map +1 -0
  104. package/dist/checks/architecture/tsconfig-extends-validation.d.ts +10 -0
  105. package/dist/checks/architecture/tsconfig-extends-validation.d.ts.map +1 -0
  106. package/dist/checks/architecture/tsconfig-extends-validation.js +78 -0
  107. package/dist/checks/architecture/tsconfig-extends-validation.js.map +1 -0
  108. package/dist/checks/index.d.ts +6 -0
  109. package/dist/checks/index.d.ts.map +1 -0
  110. package/dist/checks/index.js +6 -0
  111. package/dist/checks/index.js.map +1 -0
  112. package/dist/checks/quality/api/api-contract-validation.d.ts +15 -0
  113. package/dist/checks/quality/api/api-contract-validation.d.ts.map +1 -0
  114. package/dist/checks/quality/api/api-contract-validation.js +316 -0
  115. package/dist/checks/quality/api/api-contract-validation.js.map +1 -0
  116. package/dist/checks/quality/api/api-response-validation.d.ts +14 -0
  117. package/dist/checks/quality/api/api-response-validation.d.ts.map +1 -0
  118. package/dist/checks/quality/api/api-response-validation.js +209 -0
  119. package/dist/checks/quality/api/api-response-validation.js.map +1 -0
  120. package/dist/checks/quality/api/fastify-route-validation.d.ts +14 -0
  121. package/dist/checks/quality/api/fastify-route-validation.d.ts.map +1 -0
  122. package/dist/checks/quality/api/fastify-route-validation.js +298 -0
  123. package/dist/checks/quality/api/fastify-route-validation.js.map +1 -0
  124. package/dist/checks/quality/api/fastify-schema-coverage.d.ts +11 -0
  125. package/dist/checks/quality/api/fastify-schema-coverage.d.ts.map +1 -0
  126. package/dist/checks/quality/api/fastify-schema-coverage.js +261 -0
  127. package/dist/checks/quality/api/fastify-schema-coverage.js.map +1 -0
  128. package/dist/checks/quality/api/index.d.ts +5 -0
  129. package/dist/checks/quality/api/index.d.ts.map +1 -0
  130. package/dist/checks/quality/api/index.js +5 -0
  131. package/dist/checks/quality/api/index.js.map +1 -0
  132. package/dist/checks/quality/code-structure/duplicate-utility-functions.d.ts +32 -0
  133. package/dist/checks/quality/code-structure/duplicate-utility-functions.d.ts.map +1 -0
  134. package/dist/checks/quality/code-structure/duplicate-utility-functions.js +451 -0
  135. package/dist/checks/quality/code-structure/duplicate-utility-functions.js.map +1 -0
  136. package/dist/checks/quality/code-structure/index.d.ts +3 -0
  137. package/dist/checks/quality/code-structure/index.d.ts.map +1 -0
  138. package/dist/checks/quality/code-structure/index.js +3 -0
  139. package/dist/checks/quality/code-structure/index.js.map +1 -0
  140. package/dist/checks/quality/code-structure/no-any-types.d.ts +13 -0
  141. package/dist/checks/quality/code-structure/no-any-types.d.ts.map +1 -0
  142. package/dist/checks/quality/code-structure/no-any-types.js +116 -0
  143. package/dist/checks/quality/code-structure/no-any-types.js.map +1 -0
  144. package/dist/checks/quality/data-integrity/__tests__/null-safety-fp.test.d.ts +15 -0
  145. package/dist/checks/quality/data-integrity/__tests__/null-safety-fp.test.d.ts.map +1 -0
  146. package/dist/checks/quality/data-integrity/__tests__/null-safety-fp.test.js +51 -0
  147. package/dist/checks/quality/data-integrity/__tests__/null-safety-fp.test.js.map +1 -0
  148. package/dist/checks/quality/data-integrity/array-validation.d.ts +16 -0
  149. package/dist/checks/quality/data-integrity/array-validation.d.ts.map +1 -0
  150. package/dist/checks/quality/data-integrity/array-validation.js +508 -0
  151. package/dist/checks/quality/data-integrity/array-validation.js.map +1 -0
  152. package/dist/checks/quality/data-integrity/database-index-coverage.d.ts +14 -0
  153. package/dist/checks/quality/data-integrity/database-index-coverage.d.ts.map +1 -0
  154. package/dist/checks/quality/data-integrity/database-index-coverage.js +235 -0
  155. package/dist/checks/quality/data-integrity/database-index-coverage.js.map +1 -0
  156. package/dist/checks/quality/data-integrity/database-schema-validation.d.ts +16 -0
  157. package/dist/checks/quality/data-integrity/database-schema-validation.d.ts.map +1 -0
  158. package/dist/checks/quality/data-integrity/database-schema-validation.js +328 -0
  159. package/dist/checks/quality/data-integrity/database-schema-validation.js.map +1 -0
  160. package/dist/checks/quality/data-integrity/in-memory-repository-detection.d.ts +14 -0
  161. package/dist/checks/quality/data-integrity/in-memory-repository-detection.d.ts.map +1 -0
  162. package/dist/checks/quality/data-integrity/in-memory-repository-detection.js +157 -0
  163. package/dist/checks/quality/data-integrity/in-memory-repository-detection.js.map +1 -0
  164. package/dist/checks/quality/data-integrity/index.d.ts +8 -0
  165. package/dist/checks/quality/data-integrity/index.d.ts.map +1 -0
  166. package/dist/checks/quality/data-integrity/index.js +8 -0
  167. package/dist/checks/quality/data-integrity/index.js.map +1 -0
  168. package/dist/checks/quality/data-integrity/missing-input-validation.d.ts +12 -0
  169. package/dist/checks/quality/data-integrity/missing-input-validation.d.ts.map +1 -0
  170. package/dist/checks/quality/data-integrity/missing-input-validation.js +180 -0
  171. package/dist/checks/quality/data-integrity/missing-input-validation.js.map +1 -0
  172. package/dist/checks/quality/data-integrity/null-safety.d.ts +33 -0
  173. package/dist/checks/quality/data-integrity/null-safety.d.ts.map +1 -0
  174. package/dist/checks/quality/data-integrity/null-safety.js +766 -0
  175. package/dist/checks/quality/data-integrity/null-safety.js.map +1 -0
  176. package/dist/checks/quality/data-integrity/numeric-validation.d.ts +12 -0
  177. package/dist/checks/quality/data-integrity/numeric-validation.d.ts.map +1 -0
  178. package/dist/checks/quality/data-integrity/numeric-validation.js +409 -0
  179. package/dist/checks/quality/data-integrity/numeric-validation.js.map +1 -0
  180. package/dist/checks/quality/frontend/a11y-form-labels.d.ts +14 -0
  181. package/dist/checks/quality/frontend/a11y-form-labels.d.ts.map +1 -0
  182. package/dist/checks/quality/frontend/a11y-form-labels.js +93 -0
  183. package/dist/checks/quality/frontend/a11y-form-labels.js.map +1 -0
  184. package/dist/checks/quality/frontend/a11y-semantic-html.d.ts +14 -0
  185. package/dist/checks/quality/frontend/a11y-semantic-html.d.ts.map +1 -0
  186. package/dist/checks/quality/frontend/a11y-semantic-html.js +88 -0
  187. package/dist/checks/quality/frontend/a11y-semantic-html.js.map +1 -0
  188. package/dist/checks/quality/frontend/index.d.ts +4 -0
  189. package/dist/checks/quality/frontend/index.d.ts.map +1 -0
  190. package/dist/checks/quality/frontend/index.js +4 -0
  191. package/dist/checks/quality/frontend/index.js.map +1 -0
  192. package/dist/checks/quality/frontend/test-only-frontend-modules.d.ts +13 -0
  193. package/dist/checks/quality/frontend/test-only-frontend-modules.d.ts.map +1 -0
  194. package/dist/checks/quality/frontend/test-only-frontend-modules.js +159 -0
  195. package/dist/checks/quality/frontend/test-only-frontend-modules.js.map +1 -0
  196. package/dist/checks/quality/incomplete-regex-escaping.d.ts +13 -0
  197. package/dist/checks/quality/incomplete-regex-escaping.d.ts.map +1 -0
  198. package/dist/checks/quality/incomplete-regex-escaping.js +207 -0
  199. package/dist/checks/quality/incomplete-regex-escaping.js.map +1 -0
  200. package/dist/checks/quality/index.d.ts +11 -0
  201. package/dist/checks/quality/index.d.ts.map +1 -0
  202. package/dist/checks/quality/index.js +11 -0
  203. package/dist/checks/quality/index.js.map +1 -0
  204. package/dist/checks/quality/linting/index.d.ts +2 -0
  205. package/dist/checks/quality/linting/index.d.ts.map +1 -0
  206. package/dist/checks/quality/linting/index.js +2 -0
  207. package/dist/checks/quality/linting/index.js.map +1 -0
  208. package/dist/checks/quality/linting/typescript-frontend.d.ts +25 -0
  209. package/dist/checks/quality/linting/typescript-frontend.d.ts.map +1 -0
  210. package/dist/checks/quality/linting/typescript-frontend.js +159 -0
  211. package/dist/checks/quality/linting/typescript-frontend.js.map +1 -0
  212. package/dist/checks/quality/observability/index.d.ts +5 -0
  213. package/dist/checks/quality/observability/index.d.ts.map +1 -0
  214. package/dist/checks/quality/observability/index.js +5 -0
  215. package/dist/checks/quality/observability/index.js.map +1 -0
  216. package/dist/checks/quality/observability/logger-event-name-format.d.ts +12 -0
  217. package/dist/checks/quality/observability/logger-event-name-format.d.ts.map +1 -0
  218. package/dist/checks/quality/observability/logger-event-name-format.js +124 -0
  219. package/dist/checks/quality/observability/logger-event-name-format.js.map +1 -0
  220. package/dist/checks/quality/observability/no-hardcoded-correlation-id.d.ts +5 -0
  221. package/dist/checks/quality/observability/no-hardcoded-correlation-id.d.ts.map +1 -0
  222. package/dist/checks/quality/observability/no-hardcoded-correlation-id.js +77 -0
  223. package/dist/checks/quality/observability/no-hardcoded-correlation-id.js.map +1 -0
  224. package/dist/checks/quality/observability/observability-coverage/__tests__/analyzer.test.d.ts +11 -0
  225. package/dist/checks/quality/observability/observability-coverage/__tests__/analyzer.test.d.ts.map +1 -0
  226. package/dist/checks/quality/observability/observability-coverage/__tests__/analyzer.test.js +107 -0
  227. package/dist/checks/quality/observability/observability-coverage/__tests__/analyzer.test.js.map +1 -0
  228. package/dist/checks/quality/observability/observability-coverage/__tests__/logger-detector.test.d.ts +12 -0
  229. package/dist/checks/quality/observability/observability-coverage/__tests__/logger-detector.test.d.ts.map +1 -0
  230. package/dist/checks/quality/observability/observability-coverage/__tests__/logger-detector.test.js +94 -0
  231. package/dist/checks/quality/observability/observability-coverage/__tests__/logger-detector.test.js.map +1 -0
  232. package/dist/checks/quality/observability/observability-coverage/analyzer.d.ts +13 -0
  233. package/dist/checks/quality/observability/observability-coverage/analyzer.d.ts.map +1 -0
  234. package/dist/checks/quality/observability/observability-coverage/analyzer.js +117 -0
  235. package/dist/checks/quality/observability/observability-coverage/analyzer.js.map +1 -0
  236. package/dist/checks/quality/observability/observability-coverage/index.d.ts +4 -0
  237. package/dist/checks/quality/observability/observability-coverage/index.d.ts.map +1 -0
  238. package/dist/checks/quality/observability/observability-coverage/index.js +4 -0
  239. package/dist/checks/quality/observability/observability-coverage/index.js.map +1 -0
  240. package/dist/checks/quality/observability/observability-coverage/logger-detector.d.ts +29 -0
  241. package/dist/checks/quality/observability/observability-coverage/logger-detector.d.ts.map +1 -0
  242. package/dist/checks/quality/observability/observability-coverage/logger-detector.js +111 -0
  243. package/dist/checks/quality/observability/observability-coverage/logger-detector.js.map +1 -0
  244. package/dist/checks/quality/observability/observability-coverage/types.d.ts +64 -0
  245. package/dist/checks/quality/observability/observability-coverage/types.d.ts.map +1 -0
  246. package/dist/checks/quality/observability/observability-coverage/types.js +6 -0
  247. package/dist/checks/quality/observability/observability-coverage/types.js.map +1 -0
  248. package/dist/checks/quality/observability/pii-exposure-in-logs.d.ts +22 -0
  249. package/dist/checks/quality/observability/pii-exposure-in-logs.d.ts.map +1 -0
  250. package/dist/checks/quality/observability/pii-exposure-in-logs.js +212 -0
  251. package/dist/checks/quality/observability/pii-exposure-in-logs.js.map +1 -0
  252. package/dist/checks/quality/observability/pii-exposure-in-logs.test.d.ts +11 -0
  253. package/dist/checks/quality/observability/pii-exposure-in-logs.test.d.ts.map +1 -0
  254. package/dist/checks/quality/observability/pii-exposure-in-logs.test.js +46 -0
  255. package/dist/checks/quality/observability/pii-exposure-in-logs.test.js.map +1 -0
  256. package/dist/checks/quality/patterns/__tests__/toctou-fp.test.d.ts +14 -0
  257. package/dist/checks/quality/patterns/__tests__/toctou-fp.test.d.ts.map +1 -0
  258. package/dist/checks/quality/patterns/__tests__/toctou-fp.test.js +61 -0
  259. package/dist/checks/quality/patterns/__tests__/toctou-fp.test.js.map +1 -0
  260. package/dist/checks/quality/patterns/async-waterfall-detection.d.ts +26 -0
  261. package/dist/checks/quality/patterns/async-waterfall-detection.d.ts.map +1 -0
  262. package/dist/checks/quality/patterns/async-waterfall-detection.js +410 -0
  263. package/dist/checks/quality/patterns/async-waterfall-detection.js.map +1 -0
  264. package/dist/checks/quality/patterns/dispose-pattern-completeness.d.ts +13 -0
  265. package/dist/checks/quality/patterns/dispose-pattern-completeness.d.ts.map +1 -0
  266. package/dist/checks/quality/patterns/dispose-pattern-completeness.js +220 -0
  267. package/dist/checks/quality/patterns/dispose-pattern-completeness.js.map +1 -0
  268. package/dist/checks/quality/patterns/error-handling-quality.d.ts +17 -0
  269. package/dist/checks/quality/patterns/error-handling-quality.d.ts.map +1 -0
  270. package/dist/checks/quality/patterns/error-handling-quality.js +335 -0
  271. package/dist/checks/quality/patterns/error-handling-quality.js.map +1 -0
  272. package/dist/checks/quality/patterns/index.d.ts +10 -0
  273. package/dist/checks/quality/patterns/index.d.ts.map +1 -0
  274. package/dist/checks/quality/patterns/index.js +10 -0
  275. package/dist/checks/quality/patterns/index.js.map +1 -0
  276. package/dist/checks/quality/patterns/lifecycle-cleanup-enforcement.d.ts +16 -0
  277. package/dist/checks/quality/patterns/lifecycle-cleanup-enforcement.d.ts.map +1 -0
  278. package/dist/checks/quality/patterns/lifecycle-cleanup-enforcement.js +205 -0
  279. package/dist/checks/quality/patterns/lifecycle-cleanup-enforcement.js.map +1 -0
  280. package/dist/checks/quality/patterns/result-pattern-consistency.d.ts +16 -0
  281. package/dist/checks/quality/patterns/result-pattern-consistency.d.ts.map +1 -0
  282. package/dist/checks/quality/patterns/result-pattern-consistency.js +328 -0
  283. package/dist/checks/quality/patterns/result-pattern-consistency.js.map +1 -0
  284. package/dist/checks/quality/patterns/silent-early-returns.d.ts +23 -0
  285. package/dist/checks/quality/patterns/silent-early-returns.d.ts.map +1 -0
  286. package/dist/checks/quality/patterns/silent-early-returns.js +266 -0
  287. package/dist/checks/quality/patterns/silent-early-returns.js.map +1 -0
  288. package/dist/checks/quality/patterns/stream-buffer-size-limits.d.ts +13 -0
  289. package/dist/checks/quality/patterns/stream-buffer-size-limits.d.ts.map +1 -0
  290. package/dist/checks/quality/patterns/stream-buffer-size-limits.js +163 -0
  291. package/dist/checks/quality/patterns/stream-buffer-size-limits.js.map +1 -0
  292. package/dist/checks/quality/patterns/throws-documentation.d.ts +23 -0
  293. package/dist/checks/quality/patterns/throws-documentation.d.ts.map +1 -0
  294. package/dist/checks/quality/patterns/throws-documentation.js +519 -0
  295. package/dist/checks/quality/patterns/throws-documentation.js.map +1 -0
  296. package/dist/checks/quality/patterns/toctou-race-condition.d.ts +48 -0
  297. package/dist/checks/quality/patterns/toctou-race-condition.d.ts.map +1 -0
  298. package/dist/checks/quality/patterns/toctou-race-condition.js +639 -0
  299. package/dist/checks/quality/patterns/toctou-race-condition.js.map +1 -0
  300. package/dist/checks/quality/stubbed-implementation-detection.d.ts +24 -0
  301. package/dist/checks/quality/stubbed-implementation-detection.d.ts.map +1 -0
  302. package/dist/checks/quality/stubbed-implementation-detection.js +355 -0
  303. package/dist/checks/quality/stubbed-implementation-detection.js.map +1 -0
  304. package/dist/checks/quality/unused-config-options.d.ts +12 -0
  305. package/dist/checks/quality/unused-config-options.d.ts.map +1 -0
  306. package/dist/checks/quality/unused-config-options.js +245 -0
  307. package/dist/checks/quality/unused-config-options.js.map +1 -0
  308. package/dist/checks/resilience/__tests__/callback-invocation-safe.test.d.ts +2 -0
  309. package/dist/checks/resilience/__tests__/callback-invocation-safe.test.d.ts.map +1 -0
  310. package/dist/checks/resilience/__tests__/callback-invocation-safe.test.js +79 -0
  311. package/dist/checks/resilience/__tests__/callback-invocation-safe.test.js.map +1 -0
  312. package/dist/checks/resilience/__tests__/context-leakage-fp.test.d.ts +12 -0
  313. package/dist/checks/resilience/__tests__/context-leakage-fp.test.d.ts.map +1 -0
  314. package/dist/checks/resilience/__tests__/context-leakage-fp.test.js +34 -0
  315. package/dist/checks/resilience/__tests__/context-leakage-fp.test.js.map +1 -0
  316. package/dist/checks/resilience/__tests__/context-mutation.test.d.ts +11 -0
  317. package/dist/checks/resilience/__tests__/context-mutation.test.d.ts.map +1 -0
  318. package/dist/checks/resilience/__tests__/context-mutation.test.js +54 -0
  319. package/dist/checks/resilience/__tests__/context-mutation.test.js.map +1 -0
  320. package/dist/checks/resilience/callback-invocation-safe.d.ts +34 -0
  321. package/dist/checks/resilience/callback-invocation-safe.d.ts.map +1 -0
  322. package/dist/checks/resilience/callback-invocation-safe.js +247 -0
  323. package/dist/checks/resilience/callback-invocation-safe.js.map +1 -0
  324. package/dist/checks/resilience/context-leakage.d.ts +25 -0
  325. package/dist/checks/resilience/context-leakage.d.ts.map +1 -0
  326. package/dist/checks/resilience/context-leakage.js +435 -0
  327. package/dist/checks/resilience/context-leakage.js.map +1 -0
  328. package/dist/checks/resilience/context-mutation.d.ts +21 -0
  329. package/dist/checks/resilience/context-mutation.d.ts.map +1 -0
  330. package/dist/checks/resilience/context-mutation.js +368 -0
  331. package/dist/checks/resilience/context-mutation.js.map +1 -0
  332. package/dist/checks/resilience/detached-promises.d.ts +40 -0
  333. package/dist/checks/resilience/detached-promises.d.ts.map +1 -0
  334. package/dist/checks/resilience/detached-promises.js +646 -0
  335. package/dist/checks/resilience/detached-promises.js.map +1 -0
  336. package/dist/checks/resilience/index.d.ts +7 -0
  337. package/dist/checks/resilience/index.d.ts.map +1 -0
  338. package/dist/checks/resilience/index.js +7 -0
  339. package/dist/checks/resilience/index.js.map +1 -0
  340. package/dist/checks/resilience/no-raw-fetch.d.ts +11 -0
  341. package/dist/checks/resilience/no-raw-fetch.d.ts.map +1 -0
  342. package/dist/checks/resilience/no-raw-fetch.js +110 -0
  343. package/dist/checks/resilience/no-raw-fetch.js.map +1 -0
  344. package/dist/checks/resilience/no-unbounded-concurrency.d.ts +11 -0
  345. package/dist/checks/resilience/no-unbounded-concurrency.d.ts.map +1 -0
  346. package/dist/checks/resilience/no-unbounded-concurrency.js +117 -0
  347. package/dist/checks/resilience/no-unbounded-concurrency.js.map +1 -0
  348. package/dist/checks/security/__tests__/sql-injection.test.d.ts +17 -0
  349. package/dist/checks/security/__tests__/sql-injection.test.d.ts.map +1 -0
  350. package/dist/checks/security/__tests__/sql-injection.test.js +97 -0
  351. package/dist/checks/security/__tests__/sql-injection.test.js.map +1 -0
  352. package/dist/checks/security/index.d.ts +4 -0
  353. package/dist/checks/security/index.d.ts.map +1 -0
  354. package/dist/checks/security/index.js +4 -0
  355. package/dist/checks/security/index.js.map +1 -0
  356. package/dist/checks/security/input-sanitization.d.ts +20 -0
  357. package/dist/checks/security/input-sanitization.d.ts.map +1 -0
  358. package/dist/checks/security/input-sanitization.js +255 -0
  359. package/dist/checks/security/input-sanitization.js.map +1 -0
  360. package/dist/checks/security/sql-injection.d.ts +24 -0
  361. package/dist/checks/security/sql-injection.d.ts.map +1 -0
  362. package/dist/checks/security/sql-injection.js +330 -0
  363. package/dist/checks/security/sql-injection.js.map +1 -0
  364. package/dist/checks/security/unsafe-secret-comparison.d.ts +17 -0
  365. package/dist/checks/security/unsafe-secret-comparison.d.ts.map +1 -0
  366. package/dist/checks/security/unsafe-secret-comparison.js +227 -0
  367. package/dist/checks/security/unsafe-secret-comparison.js.map +1 -0
  368. package/dist/checks/testing/index.d.ts +2 -0
  369. package/dist/checks/testing/index.d.ts.map +1 -0
  370. package/dist/checks/testing/index.js +2 -0
  371. package/dist/checks/testing/index.js.map +1 -0
  372. package/dist/checks/testing/mock-implementations-in-production.d.ts +12 -0
  373. package/dist/checks/testing/mock-implementations-in-production.d.ts.map +1 -0
  374. package/dist/checks/testing/mock-implementations-in-production.js +211 -0
  375. package/dist/checks/testing/mock-implementations-in-production.js.map +1 -0
  376. package/dist/display/architecture.d.ts +9 -0
  377. package/dist/display/architecture.d.ts.map +1 -0
  378. package/dist/display/architecture.js +18 -0
  379. package/dist/display/architecture.js.map +1 -0
  380. package/dist/display/index.d.ts +20 -0
  381. package/dist/display/index.d.ts.map +1 -0
  382. package/dist/display/index.js +30 -0
  383. package/dist/display/index.js.map +1 -0
  384. package/dist/display/quality.d.ts +7 -0
  385. package/dist/display/quality.d.ts.map +1 -0
  386. package/dist/display/quality.js +39 -0
  387. package/dist/display/quality.js.map +1 -0
  388. package/dist/display/resilience.d.ts +7 -0
  389. package/dist/display/resilience.d.ts.map +1 -0
  390. package/dist/display/resilience.js +13 -0
  391. package/dist/display/resilience.js.map +1 -0
  392. package/dist/display/security-testing.d.ts +9 -0
  393. package/dist/display/security-testing.d.ts.map +1 -0
  394. package/dist/display/security-testing.js +14 -0
  395. package/dist/display/security-testing.js.map +1 -0
  396. package/dist/display/types.d.ts +6 -0
  397. package/dist/display/types.d.ts.map +1 -0
  398. package/dist/display/types.js +6 -0
  399. package/dist/display/types.js.map +1 -0
  400. package/dist/index.d.ts +19 -0
  401. package/dist/index.d.ts.map +1 -0
  402. package/dist/index.js +21 -0
  403. package/dist/index.js.map +1 -0
  404. package/package.json +55 -0
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @fileoverview Direct unit tests for the observability-coverage logger
3
+ * detector helper module.
4
+ *
5
+ * Exercises:
6
+ * - logger.* / this.logger.* / direct logToFitnessFile/logToCLIFile detection
7
+ * - line-range filtering (out-of-range calls are excluded)
8
+ * - non-logger property access calls (e.g., db.info) are ignored
9
+ * - fileImportsLogger over import-path patterns and direct identifiers
10
+ */
11
+ import { describe, expect, it } from 'vitest';
12
+ import { detectLoggerCalls, fileImportsLogger } from '../logger-detector.js';
13
+ describe('logger-detector — detectLoggerCalls', () => {
14
+ it('returns an empty array when the source has no parseable AST', () => {
15
+ // Empty path yields a falsy SourceFile from getSharedSourceFile in some
16
+ // configurations; even when it parses, an empty body has no calls.
17
+ expect(detectLoggerCalls('', 'empty.ts', 1, 5)).toEqual([]);
18
+ });
19
+ it('detects bare-identifier logger calls (logger.info)', () => {
20
+ const src = `
21
+ export function f() {
22
+ logger.info({ msg: 'hi' })
23
+ }
24
+ `;
25
+ const calls = detectLoggerCalls(src, 'a.ts', 1, 10);
26
+ expect(calls).toHaveLength(1);
27
+ expect(calls[0]?.level).toBe('info');
28
+ });
29
+ it('detects this.logger.* calls inside class methods', () => {
30
+ const src = `
31
+ export class S {
32
+ run() {
33
+ this.logger.warn({ msg: 'hi' })
34
+ this.logger.error('boom')
35
+ }
36
+ }
37
+ `;
38
+ const calls = detectLoggerCalls(src, 'class.ts', 1, 20);
39
+ expect(calls.map((c) => c.level).sort()).toEqual(['error', 'warn']);
40
+ });
41
+ it('excludes calls outside the requested line range', () => {
42
+ const src = [
43
+ 'function a() {', // line 1
44
+ ' logger.info({ msg: 1 })', // line 2 (in range)
45
+ '}', // line 3
46
+ 'function b() {', // line 4
47
+ ' logger.warn({ msg: 2 })', // line 5 (out of range)
48
+ '}', // line 6
49
+ ].join('\n');
50
+ const calls = detectLoggerCalls(src, 'range.ts', 1, 3);
51
+ expect(calls).toHaveLength(1);
52
+ expect(calls[0]?.level).toBe('info');
53
+ });
54
+ it('detects logToFitnessFile / logToCLIFile direct calls', () => {
55
+ const src = `
56
+ logToFitnessFile({ msg: 'a' })
57
+ logToCLIFile({ msg: 'b' })
58
+ `;
59
+ const calls = detectLoggerCalls(src, 'direct.ts', 1, 10);
60
+ expect(calls).toHaveLength(2);
61
+ // Direct calls are normalized to 'info' level.
62
+ expect(calls.every((c) => c.level === 'info')).toBe(true);
63
+ });
64
+ it('does not match non-logger property access calls', () => {
65
+ const src = `
66
+ const db = { info(_: unknown) {}, warn(_: unknown) {} }
67
+ db.info({ msg: 'no' })
68
+ db.warn({ msg: 'no' })
69
+ `;
70
+ expect(detectLoggerCalls(src, 'no.ts', 1, 10)).toEqual([]);
71
+ });
72
+ it('ignores property-access calls whose method is not a known logger level', () => {
73
+ const src = `
74
+ logger.trace({ msg: 'unknown level' })
75
+ logger.fatal({ msg: 'unknown level' })
76
+ `;
77
+ // Detector recognizes only info/warn/error/debug.
78
+ expect(detectLoggerCalls(src, 'level.ts', 1, 10)).toEqual([]);
79
+ });
80
+ });
81
+ describe('logger-detector — fileImportsLogger', () => {
82
+ it('detects import-from-/logger paths', () => {
83
+ expect(fileImportsLogger(`import { logger } from '@some/pkg/logger'`)).toBe(true);
84
+ expect(fileImportsLogger(`import x from '../utils/logger'`)).toBe(true);
85
+ });
86
+ it('detects logToFitnessFile / logToCLIFile direct identifier usage', () => {
87
+ expect(fileImportsLogger('export const f = () => logToFitnessFile({})')).toBe(true);
88
+ expect(fileImportsLogger('export const g = () => logToCLIFile({})')).toBe(true);
89
+ });
90
+ it('returns false when neither pattern is present', () => {
91
+ expect(fileImportsLogger("import x from 'react'\nexport const x = 1")).toBe(false);
92
+ });
93
+ });
94
+ //# sourceMappingURL=logger-detector.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-detector.test.js","sourceRoot":"","sources":["../../../../../../src/checks/quality/observability/observability-coverage/__tests__/logger-detector.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE7E,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,wEAAwE;QACxE,mEAAmE;QACnE,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,GAAG,GAAG;;;;KAIX,CAAC;QACF,MAAM,KAAK,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,I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,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,iBAAiB,CAAC,2CAA2C,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview AST function extractor for observability coverage analysis
3
+ */
4
+ import type { FunctionInfo } from './types.js';
5
+ /**
6
+ * Extract functions, arrow functions, class methods, and constructors from
7
+ * TypeScript source code using the raw compiler API.
8
+ *
9
+ * This module only performs AST extraction. Logger detection is handled
10
+ * separately by the logger-detector module.
11
+ */
12
+ export declare function extractFunctions(content: string, filePath: string): FunctionInfo[];
13
+ //# sourceMappingURL=analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/analyzer.ts"],"names":[],"mappings":"AACA;;GAEG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAyE/C;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CA8ClF"}
@@ -0,0 +1,117 @@
1
+ // @fitness-ignore-file fitness-check-architecture -- Helper module for observability-coverage check, not a standalone check
2
+ /**
3
+ * @fileoverview AST function extractor for observability coverage analysis
4
+ */
5
+ import { getSharedSourceFile, isAsync } from '@opensip-cli/lang-typescript';
6
+ import * as ts from 'typescript';
7
+ /**
8
+ * Recursively walk a subtree looking for a TryStatement.
9
+ */
10
+ function containsTryCatch(node) {
11
+ if (ts.isTryStatement(node)) {
12
+ return true;
13
+ }
14
+ let found = false;
15
+ node.forEachChild((child) => {
16
+ if (!found && containsTryCatch(child)) {
17
+ found = true;
18
+ }
19
+ });
20
+ return found;
21
+ }
22
+ /**
23
+ * Check whether a node is a getter or setter accessor.
24
+ */
25
+ function isAccessor(node) {
26
+ return ts.isGetAccessorDeclaration(node) || ts.isSetAccessorDeclaration(node);
27
+ }
28
+ /**
29
+ * Check whether a function-like node has a body.
30
+ * Abstract methods, overload signatures, and interface method signatures have no body.
31
+ */
32
+ function hasBody(node) {
33
+ if (ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node)) {
34
+ return node.body !== undefined;
35
+ }
36
+ /* v8 ignore next -- defensive AST/type guard */
37
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
38
+ return true;
39
+ }
40
+ if (ts.isConstructorDeclaration(node)) {
41
+ return node.body !== undefined;
42
+ }
43
+ return false;
44
+ }
45
+ /**
46
+ * Build a FunctionInfo from a function-like AST node.
47
+ */
48
+ function buildFunctionInfo(name, node, body, sourceFile, filePath) {
49
+ const startPos = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));
50
+ const endPos = sourceFile.getLineAndCharacterOfPosition(node.getEnd());
51
+ const startLine = startPos.line + 1;
52
+ const endLine = endPos.line + 1;
53
+ return {
54
+ name,
55
+ filePath,
56
+ startLine,
57
+ endLine,
58
+ lineCount: endLine - startLine + 1,
59
+ isAsync: isAsync(node),
60
+ hasTryCatch: containsTryCatch(body),
61
+ hasLogging: false,
62
+ loggerCalls: [],
63
+ };
64
+ }
65
+ /**
66
+ * Extract functions, arrow functions, class methods, and constructors from
67
+ * TypeScript source code using the raw compiler API.
68
+ *
69
+ * This module only performs AST extraction. Logger detection is handled
70
+ * separately by the logger-detector module.
71
+ */
72
+ export function extractFunctions(content, filePath) {
73
+ const parsed = getSharedSourceFile(filePath, content);
74
+ /* v8 ignore next -- defensive AST/type guard */
75
+ if (!parsed)
76
+ return [];
77
+ const sourceFile = parsed;
78
+ const functions = [];
79
+ function resolveFunctionExpressionName(node) {
80
+ if (ts.isVariableDeclaration(node.parent)) {
81
+ return node.parent.name.getText(sourceFile);
82
+ }
83
+ if (ts.isPropertyAssignment(node.parent)) {
84
+ return node.parent.name.getText(sourceFile);
85
+ }
86
+ /* v8 ignore next -- defensive AST/type guard */
87
+ if (ts.isFunctionExpression(node) && node.name) {
88
+ return node.name.getText(sourceFile);
89
+ }
90
+ return '<anonymous>';
91
+ }
92
+ function visit(node) {
93
+ // Skip getters and setters explicitly
94
+ if (isAccessor(node)) {
95
+ return;
96
+ }
97
+ if (ts.isFunctionDeclaration(node) && hasBody(node) && node.body) {
98
+ const name = node.name?.getText(sourceFile) ?? '<anonymous>';
99
+ functions.push(buildFunctionInfo(name, node, node.body, sourceFile, filePath));
100
+ }
101
+ else if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
102
+ const name = resolveFunctionExpressionName(node);
103
+ functions.push(buildFunctionInfo(name, node, node.body, sourceFile, filePath));
104
+ }
105
+ else if (ts.isConstructorDeclaration(node) && hasBody(node) && node.body) {
106
+ functions.push(buildFunctionInfo('constructor', node, node.body, sourceFile, filePath));
107
+ }
108
+ else if (ts.isMethodDeclaration(node) && hasBody(node) && node.body) {
109
+ const name = node.name.getText(sourceFile);
110
+ functions.push(buildFunctionInfo(name, node, node.body, sourceFile, filePath));
111
+ }
112
+ ts.forEachChild(node, visit);
113
+ }
114
+ visit(sourceFile);
115
+ return functions;
116
+ }
117
+ //# sourceMappingURL=analyzer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/analyzer.ts"],"names":[],"mappings":"AAAA,4HAA4H;AAC5H;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAa;IACrC,IAAI,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,YAAY,CAAC,CAAC,K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E,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QACjF,CAAC;QAED,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,CAAC;IAElB,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './analyzer.js';
2
+ export * from './logger-detector.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './analyzer.js';
2
+ export * from './logger-detector.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @fileoverview Logger call detector for observability coverage analysis
3
+ */
4
+ import type { LoggerCall } from './types.js';
5
+ /**
6
+ * Detect logger calls within a specific line range of a source file.
7
+ *
8
+ * Walks the AST looking for:
9
+ * - Property access calls like `logger.info(...)`, `logger.warn(...)`, etc.
10
+ * - Direct calls to `logToFitnessFile(...)` or `logToCLIFile(...)`
11
+ *
12
+ * @param content - Full source file content
13
+ * @param filePath - Path to the source file (used for AST parsing)
14
+ * @param startLine - 1-indexed start line of the range to inspect
15
+ * @param endLine - 1-indexed end line of the range to inspect
16
+ * @returns Array of detected logger calls within the given line range
17
+ */
18
+ export declare function detectLoggerCalls(content: string, filePath: string, startLine: number, endLine: number): LoggerCall[];
19
+ /**
20
+ * Check whether a file imports a logger.
21
+ *
22
+ * Looks for imports from a structured logger module,
23
+ * imports of `logToFitnessFile`, or imports of `logToCLIFile`.
24
+ *
25
+ * @param content - Full source file content
26
+ * @returns True if the file imports a logger, false otherwise
27
+ */
28
+ export declare function fileImportsLogger(content: string): boolean;
29
+ //# sourceMappingURL=logger-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-detector.d.ts","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/logger-detector.ts"],"names":[],"mappings":"AACA;;GAEG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,UAAU,EAAE,CAyBd;AAyED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAM1D"}
@@ -0,0 +1,111 @@
1
+ // @fitness-ignore-file fitness-check-architecture -- Helper module for observability-coverage check, not a standalone check
2
+ /**
3
+ * @fileoverview Logger call detector for observability coverage analysis
4
+ */
5
+ import { getSharedSourceFile } from '@opensip-cli/lang-typescript';
6
+ import * as ts from 'typescript';
7
+ /** Logger method names we recognize as logging calls */
8
+ const LOGGER_METHODS = new Set(['info', 'warn', 'error', 'debug']);
9
+ /**
10
+ * Detect logger calls within a specific line range of a source file.
11
+ *
12
+ * Walks the AST looking for:
13
+ * - Property access calls like `logger.info(...)`, `logger.warn(...)`, etc.
14
+ * - Direct calls to `logToFitnessFile(...)` or `logToCLIFile(...)`
15
+ *
16
+ * @param content - Full source file content
17
+ * @param filePath - Path to the source file (used for AST parsing)
18
+ * @param startLine - 1-indexed start line of the range to inspect
19
+ * @param endLine - 1-indexed end line of the range to inspect
20
+ * @returns Array of detected logger calls within the given line range
21
+ */
22
+ export function detectLoggerCalls(content, filePath, startLine, endLine) {
23
+ const sourceFile = getSharedSourceFile(filePath, content);
24
+ /* v8 ignore next -- defensive guard */
25
+ if (!sourceFile)
26
+ return [];
27
+ // Local non-nullable alias so the nested `visit` function declaration —
28
+ // which TypeScript treats as hoisted and therefore non-narrowing — can
29
+ // still see a non-null SourceFile.
30
+ const sf = sourceFile;
31
+ const calls = [];
32
+ function visit(node) {
33
+ if (ts.isCallExpression(node)) {
34
+ const call = extractLoggerCall(node, sf, startLine, endLine);
35
+ if (call) {
36
+ calls.push(call);
37
+ }
38
+ }
39
+ ts.forEachChild(node, visit);
40
+ }
41
+ ts.forEachChild(sf, visit);
42
+ return calls;
43
+ }
44
+ /**
45
+ * Check whether an expression resolves to a logger instance.
46
+ *
47
+ * Matches:
48
+ * - `logger` (bare identifier)
49
+ * - `this.logger` (class instance property)
50
+ */
51
+ function isLoggerReceiver(node) {
52
+ // logger.info(...)
53
+ if (ts.isIdentifier(node) && node.text === 'logger') {
54
+ return true;
55
+ }
56
+ // this.logger.info(...)
57
+ if (ts.isPropertyAccessExpression(node) &&
58
+ node.expression.kind === ts.SyntaxKind.ThisKeyword &&
59
+ node.name.text === 'logger') {
60
+ return true;
61
+ }
62
+ return false;
63
+ }
64
+ /**
65
+ * Extract a LoggerCall from a call expression if it matches our patterns.
66
+ *
67
+ * @returns A LoggerCall if the node is a recognized logger call within range, or undefined
68
+ */
69
+ function extractLoggerCall(node, sourceFile, startLine, endLine) {
70
+ // @fitness-ignore-next-line null-safety -- getLineAndCharacterOfPosition always returns a valid {line, character} object
71
+ const lineNumber = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
72
+ if (lineNumber < startLine || lineNumber > endLine) {
73
+ return undefined;
74
+ }
75
+ // Check for property access calls: logger.info(...), this.logger.warn(...), etc.
76
+ if (ts.isPropertyAccessExpression(node.expression)) {
77
+ const propertyAccess = node.expression;
78
+ // @fitness-ignore-next-line null-safety -- ts.isPropertyAccessExpression guarantees .name is a valid Identifier node
79
+ const methodName = propertyAccess.name.text;
80
+ if (LOGGER_METHODS.has(methodName) && isLoggerReceiver(propertyAccess.expression)) {
81
+ return {
82
+ line: lineNumber,
83
+ level: methodName,
84
+ };
85
+ }
86
+ }
87
+ // Check for direct calls: logToFitnessFile(...), logToCLIFile(...)
88
+ if (ts.isIdentifier(node.expression) &&
89
+ (node.expression.text === 'logToFitnessFile' || node.expression.text === 'logToCLIFile')) {
90
+ return {
91
+ line: lineNumber,
92
+ level: 'info',
93
+ };
94
+ }
95
+ return undefined;
96
+ }
97
+ /**
98
+ * Check whether a file imports a logger.
99
+ *
100
+ * Looks for imports from a structured logger module,
101
+ * imports of `logToFitnessFile`, or imports of `logToCLIFile`.
102
+ *
103
+ * @param content - Full source file content
104
+ * @returns True if the file imports a logger, false otherwise
105
+ */
106
+ export function fileImportsLogger(content) {
107
+ return (/(?:\/logger['"]|from\s+['"][^'"]*logger)/.test(content) ||
108
+ content.includes('logToFitnessFile') ||
109
+ content.includes('logToCLIFile'));
110
+ }
111
+ //# sourceMappingURL=logger-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-detector.js","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/logger-detector.ts"],"names":[],"mappings":"AAAA,4HAA4H;AAC5H;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,wDAAwD;AACxD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,OAAe;IAEf,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1D,uCAAuC;I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AAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;IAEhG,IAAI,UAAU,GAAG,SAAS,IAAI,UAAU,GAAG,OAAO,EAAE,CAAC;QACnD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,iFAAiF;IACjF,IAAI,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACnD,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC;QACvC,qHAAqH;QACrH,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;QAE5C,IAAI,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;YAClF,OAAO;gBACL,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,UAAiC;aACzC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,IACE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QAChC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,kBAAkB,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,EACxF,CAAC;QACD,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,MAAM;SACd,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,CACL,0CAA0C,CAAC,IAAI,CAAC,OAAO,CAAC;QACxD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @fileoverview Type definitions for observability coverage analysis
3
+ */
4
+ /**
5
+ * Detected logger call within a function body.
6
+ */
7
+ export interface LoggerCall {
8
+ /** 1-indexed line number */
9
+ readonly line: number;
10
+ /** Logger level (info, warn, error, debug) */
11
+ readonly level: 'info' | 'warn' | 'error' | 'debug';
12
+ }
13
+ /**
14
+ * Information about an extracted function from the AST.
15
+ */
16
+ export interface FunctionInfo {
17
+ /** Function name (or '<anonymous>' for unnamed functions) */
18
+ readonly name: string;
19
+ /** Absolute file path */
20
+ readonly filePath: string;
21
+ /** 1-indexed start line */
22
+ readonly startLine: number;
23
+ /** 1-indexed end line */
24
+ readonly endLine: number;
25
+ /** Total lines of code in the function body */
26
+ readonly lineCount: number;
27
+ /** Whether the function is async */
28
+ readonly isAsync: boolean;
29
+ /** Whether the function contains a try/catch block */
30
+ readonly hasTryCatch: boolean;
31
+ /** Whether any logger calls were detected */
32
+ readonly hasLogging: boolean;
33
+ /** List of detected logger calls */
34
+ readonly loggerCalls: readonly LoggerCall[];
35
+ }
36
+ /**
37
+ * Aggregate coverage result across all analyzed files.
38
+ */
39
+ export interface CoverageResult {
40
+ /** Total number of functions that require logging */
41
+ readonly totalFunctions: number;
42
+ /** Number of functions that have at least one logger call */
43
+ readonly functionsWithLogging: number;
44
+ /** Coverage percentage (0-100) */
45
+ readonly coveragePercent: number;
46
+ /** Functions that require logging but don't have it */
47
+ readonly unloggedFunctions: readonly FunctionInfo[];
48
+ }
49
+ /**
50
+ * Inline configuration for the observability coverage check.
51
+ */
52
+ export interface CoverageConfig {
53
+ /** Minimum lines of code for a function to require logging */
54
+ readonly minLinesForLogging: number;
55
+ /** Whether async functions require logging (subject to minLinesForAsyncLogging) */
56
+ readonly requireLoggingInAsync: boolean;
57
+ /** Minimum lines for an async function to require logging (avoids flagging trivial async wrappers) */
58
+ readonly minLinesForAsyncLogging: number;
59
+ /** Whether functions with try/catch always require logging regardless of line count */
60
+ readonly requireLoggingInTryCatch: boolean;
61
+ /** Minimum coverage percentage before the check reports errors (vs warnings) */
62
+ readonly minCoveragePercent: number;
63
+ }
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/types.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2BAA2B;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,yBAAyB;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,kCAAkC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,uDAAuD;IACvD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,YAAY,EAAE,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,mFAAmF;IACnF,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,sGAAsG;IACtG,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,uFAAuF;IACvF,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;IAC3C,gFAAgF;IAChF,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC"}
@@ -0,0 +1,6 @@
1
+ // @fitness-ignore-file fitness-check-architecture -- Type definitions for observability-coverage check, not a standalone check
2
+ /**
3
+ * @fileoverview Type definitions for observability coverage analysis
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/checks/quality/observability/observability-coverage/types.ts"],"names":[],"mappings":"AAAA,+HAA+H;AAC/H;;GAEG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @fileoverview PII Exposure in Logs Check
3
+ *
4
+ * Uses AST analysis to detect PII exposure in log statements.
5
+ * Walks call expressions to find logger.info/warn/error/debug/trace/fatal calls,
6
+ * then inspects arguments for PII field names. AST context eliminates false
7
+ * positives from PII field names in non-log contexts (type definitions,
8
+ * variable names, string constants).
9
+ *
10
+ * @see Logging Standards
11
+ */
12
+ /**
13
+ * Check: quality/pii-exposure-in-logs
14
+ *
15
+ * Detects potential PII exposure in log statements using AST analysis.
16
+ * Walks call expressions to find logger calls, then inspects arguments
17
+ * for PII field names in object literals.
18
+ *
19
+ * @see Logging Standards
20
+ */
21
+ export declare const piiExposureInLogs: import("@opensip-cli/fitness").Check;
22
+ //# sourceMappingURL=pii-exposure-in-logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pii-exposure-in-logs.d.ts","sourceRoot":"","sources":["../../../../src/checks/quality/observability/pii-exposure-in-logs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqJH;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,sCA8D5B,CAAC"}