driftdetect-detectors 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.
- package/dist/accessibility/alt-text.d.ts +63 -0
- package/dist/accessibility/alt-text.d.ts.map +1 -0
- package/dist/accessibility/alt-text.js +100 -0
- package/dist/accessibility/alt-text.js.map +1 -0
- package/dist/accessibility/aria-roles.d.ts +65 -0
- package/dist/accessibility/aria-roles.d.ts.map +1 -0
- package/dist/accessibility/aria-roles.js +87 -0
- package/dist/accessibility/aria-roles.js.map +1 -0
- package/dist/accessibility/focus-management.d.ts +62 -0
- package/dist/accessibility/focus-management.d.ts.map +1 -0
- package/dist/accessibility/focus-management.js +88 -0
- package/dist/accessibility/focus-management.js.map +1 -0
- package/dist/accessibility/heading-hierarchy.d.ts +66 -0
- package/dist/accessibility/heading-hierarchy.d.ts.map +1 -0
- package/dist/accessibility/heading-hierarchy.js +94 -0
- package/dist/accessibility/heading-hierarchy.js.map +1 -0
- package/dist/accessibility/index.d.ts +25 -0
- package/dist/accessibility/index.d.ts.map +1 -0
- package/dist/accessibility/index.js +21 -0
- package/dist/accessibility/index.js.map +1 -0
- package/dist/accessibility/keyboard-nav.d.ts +63 -0
- package/dist/accessibility/keyboard-nav.d.ts.map +1 -0
- package/dist/accessibility/keyboard-nav.js +86 -0
- package/dist/accessibility/keyboard-nav.js.map +1 -0
- package/dist/accessibility/semantic-html.d.ts +76 -0
- package/dist/accessibility/semantic-html.d.ts.map +1 -0
- package/dist/accessibility/semantic-html.js +204 -0
- package/dist/accessibility/semantic-html.js.map +1 -0
- package/dist/api/client-patterns.d.ts +121 -0
- package/dist/api/client-patterns.d.ts.map +1 -0
- package/dist/api/client-patterns.js +478 -0
- package/dist/api/client-patterns.js.map +1 -0
- package/dist/api/error-format.d.ts +140 -0
- package/dist/api/error-format.d.ts.map +1 -0
- package/dist/api/error-format.js +614 -0
- package/dist/api/error-format.js.map +1 -0
- package/dist/api/http-methods.d.ts +255 -0
- package/dist/api/http-methods.d.ts.map +1 -0
- package/dist/api/http-methods.js +890 -0
- package/dist/api/http-methods.js.map +1 -0
- package/dist/api/index.d.ts +16 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +37 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/pagination.d.ts +133 -0
- package/dist/api/pagination.d.ts.map +1 -0
- package/dist/api/pagination.js +521 -0
- package/dist/api/pagination.js.map +1 -0
- package/dist/api/response-envelope.d.ts +261 -0
- package/dist/api/response-envelope.d.ts.map +1 -0
- package/dist/api/response-envelope.js +1050 -0
- package/dist/api/response-envelope.js.map +1 -0
- package/dist/api/retry-patterns.d.ts +117 -0
- package/dist/api/retry-patterns.d.ts.map +1 -0
- package/dist/api/retry-patterns.js +480 -0
- package/dist/api/retry-patterns.js.map +1 -0
- package/dist/api/route-structure.d.ts +128 -0
- package/dist/api/route-structure.d.ts.map +1 -0
- package/dist/api/route-structure.js +738 -0
- package/dist/api/route-structure.js.map +1 -0
- package/dist/auth/audit-logging.d.ts +80 -0
- package/dist/auth/audit-logging.d.ts.map +1 -0
- package/dist/auth/audit-logging.js +370 -0
- package/dist/auth/audit-logging.js.map +1 -0
- package/dist/auth/index.d.ts +33 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +49 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/middleware-usage.d.ts +65 -0
- package/dist/auth/middleware-usage.d.ts.map +1 -0
- package/dist/auth/middleware-usage.js +192 -0
- package/dist/auth/middleware-usage.js.map +1 -0
- package/dist/auth/permission-checks.d.ts +60 -0
- package/dist/auth/permission-checks.d.ts.map +1 -0
- package/dist/auth/permission-checks.js +159 -0
- package/dist/auth/permission-checks.js.map +1 -0
- package/dist/auth/rbac-patterns.d.ts +68 -0
- package/dist/auth/rbac-patterns.d.ts.map +1 -0
- package/dist/auth/rbac-patterns.js +143 -0
- package/dist/auth/rbac-patterns.js.map +1 -0
- package/dist/auth/resource-ownership.d.ts +77 -0
- package/dist/auth/resource-ownership.d.ts.map +1 -0
- package/dist/auth/resource-ownership.js +324 -0
- package/dist/auth/resource-ownership.js.map +1 -0
- package/dist/auth/token-handling.d.ts +64 -0
- package/dist/auth/token-handling.d.ts.map +1 -0
- package/dist/auth/token-handling.js +151 -0
- package/dist/auth/token-handling.js.map +1 -0
- package/dist/base/ast-detector.d.ts +421 -0
- package/dist/base/ast-detector.d.ts.map +1 -0
- package/dist/base/ast-detector.js +699 -0
- package/dist/base/ast-detector.js.map +1 -0
- package/dist/base/base-detector.d.ts +366 -0
- package/dist/base/base-detector.d.ts.map +1 -0
- package/dist/base/base-detector.js +170 -0
- package/dist/base/base-detector.js.map +1 -0
- package/dist/base/index.d.ts +12 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +17 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/regex-detector.d.ts +421 -0
- package/dist/base/regex-detector.d.ts.map +1 -0
- package/dist/base/regex-detector.js +537 -0
- package/dist/base/regex-detector.js.map +1 -0
- package/dist/base/structural-detector.d.ts +424 -0
- package/dist/base/structural-detector.d.ts.map +1 -0
- package/dist/base/structural-detector.js +731 -0
- package/dist/base/structural-detector.js.map +1 -0
- package/dist/base/types.d.ts +53 -0
- package/dist/base/types.d.ts.map +1 -0
- package/dist/base/types.js +5 -0
- package/dist/base/types.js.map +1 -0
- package/dist/components/component-structure.d.ts +163 -0
- package/dist/components/component-structure.d.ts.map +1 -0
- package/dist/components/component-structure.js +500 -0
- package/dist/components/component-structure.js.map +1 -0
- package/dist/components/composition.d.ts +287 -0
- package/dist/components/composition.d.ts.map +1 -0
- package/dist/components/composition.js +1123 -0
- package/dist/components/composition.js.map +1 -0
- package/dist/components/duplicate-detection.d.ts +251 -0
- package/dist/components/duplicate-detection.d.ts.map +1 -0
- package/dist/components/duplicate-detection.js +804 -0
- package/dist/components/duplicate-detection.js.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +51 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/near-duplicate.d.ts +402 -0
- package/dist/components/near-duplicate.d.ts.map +1 -0
- package/dist/components/near-duplicate.js +1090 -0
- package/dist/components/near-duplicate.js.map +1 -0
- package/dist/components/props-patterns.d.ts +194 -0
- package/dist/components/props-patterns.d.ts.map +1 -0
- package/dist/components/props-patterns.js +795 -0
- package/dist/components/props-patterns.js.map +1 -0
- package/dist/components/ref-forwarding.d.ts +250 -0
- package/dist/components/ref-forwarding.d.ts.map +1 -0
- package/dist/components/ref-forwarding.js +832 -0
- package/dist/components/ref-forwarding.js.map +1 -0
- package/dist/components/state-patterns.d.ts +291 -0
- package/dist/components/state-patterns.d.ts.map +1 -0
- package/dist/components/state-patterns.js +970 -0
- package/dist/components/state-patterns.js.map +1 -0
- package/dist/config/config-validation.d.ts +74 -0
- package/dist/config/config-validation.d.ts.map +1 -0
- package/dist/config/config-validation.js +446 -0
- package/dist/config/config-validation.js.map +1 -0
- package/dist/config/default-values.d.ts +72 -0
- package/dist/config/default-values.d.ts.map +1 -0
- package/dist/config/default-values.js +386 -0
- package/dist/config/default-values.js.map +1 -0
- package/dist/config/env-naming.d.ts +73 -0
- package/dist/config/env-naming.d.ts.map +1 -0
- package/dist/config/env-naming.js +429 -0
- package/dist/config/env-naming.js.map +1 -0
- package/dist/config/environment-detection.d.ts +72 -0
- package/dist/config/environment-detection.d.ts.map +1 -0
- package/dist/config/environment-detection.js +400 -0
- package/dist/config/environment-detection.js.map +1 -0
- package/dist/config/feature-flags.d.ts +72 -0
- package/dist/config/feature-flags.d.ts.map +1 -0
- package/dist/config/feature-flags.js +384 -0
- package/dist/config/feature-flags.js.map +1 -0
- package/dist/config/index.d.ts +27 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +43 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/required-optional.d.ts +71 -0
- package/dist/config/required-optional.d.ts.map +1 -0
- package/dist/config/required-optional.js +344 -0
- package/dist/config/required-optional.js.map +1 -0
- package/dist/data-access/connection-pooling.d.ts +63 -0
- package/dist/data-access/connection-pooling.d.ts.map +1 -0
- package/dist/data-access/connection-pooling.js +297 -0
- package/dist/data-access/connection-pooling.js.map +1 -0
- package/dist/data-access/dto-patterns.d.ts +64 -0
- package/dist/data-access/dto-patterns.d.ts.map +1 -0
- package/dist/data-access/dto-patterns.js +291 -0
- package/dist/data-access/dto-patterns.js.map +1 -0
- package/dist/data-access/index.d.ts +31 -0
- package/dist/data-access/index.d.ts.map +1 -0
- package/dist/data-access/index.js +49 -0
- package/dist/data-access/index.js.map +1 -0
- package/dist/data-access/n-plus-one.d.ts +60 -0
- package/dist/data-access/n-plus-one.d.ts.map +1 -0
- package/dist/data-access/n-plus-one.js +264 -0
- package/dist/data-access/n-plus-one.js.map +1 -0
- package/dist/data-access/query-patterns.d.ts +64 -0
- package/dist/data-access/query-patterns.d.ts.map +1 -0
- package/dist/data-access/query-patterns.js +314 -0
- package/dist/data-access/query-patterns.js.map +1 -0
- package/dist/data-access/repository-pattern.d.ts +62 -0
- package/dist/data-access/repository-pattern.d.ts.map +1 -0
- package/dist/data-access/repository-pattern.js +257 -0
- package/dist/data-access/repository-pattern.js.map +1 -0
- package/dist/data-access/transaction-patterns.d.ts +61 -0
- package/dist/data-access/transaction-patterns.d.ts.map +1 -0
- package/dist/data-access/transaction-patterns.js +277 -0
- package/dist/data-access/transaction-patterns.js.map +1 -0
- package/dist/data-access/validation-patterns.d.ts +62 -0
- package/dist/data-access/validation-patterns.d.ts.map +1 -0
- package/dist/data-access/validation-patterns.js +301 -0
- package/dist/data-access/validation-patterns.js.map +1 -0
- package/dist/documentation/deprecation.d.ts +62 -0
- package/dist/documentation/deprecation.d.ts.map +1 -0
- package/dist/documentation/deprecation.js +83 -0
- package/dist/documentation/deprecation.js.map +1 -0
- package/dist/documentation/example-code.d.ts +64 -0
- package/dist/documentation/example-code.d.ts.map +1 -0
- package/dist/documentation/example-code.js +79 -0
- package/dist/documentation/example-code.js.map +1 -0
- package/dist/documentation/index.d.ts +22 -0
- package/dist/documentation/index.d.ts.map +1 -0
- package/dist/documentation/index.js +19 -0
- package/dist/documentation/index.js.map +1 -0
- package/dist/documentation/jsdoc-patterns.d.ts +72 -0
- package/dist/documentation/jsdoc-patterns.d.ts.map +1 -0
- package/dist/documentation/jsdoc-patterns.js +92 -0
- package/dist/documentation/jsdoc-patterns.js.map +1 -0
- package/dist/documentation/readme-structure.d.ts +67 -0
- package/dist/documentation/readme-structure.d.ts.map +1 -0
- package/dist/documentation/readme-structure.js +76 -0
- package/dist/documentation/readme-structure.js.map +1 -0
- package/dist/documentation/todo-patterns.d.ts +67 -0
- package/dist/documentation/todo-patterns.d.ts.map +1 -0
- package/dist/documentation/todo-patterns.js +73 -0
- package/dist/documentation/todo-patterns.js.map +1 -0
- package/dist/errors/async-errors.d.ts +72 -0
- package/dist/errors/async-errors.d.ts.map +1 -0
- package/dist/errors/async-errors.js +214 -0
- package/dist/errors/async-errors.js.map +1 -0
- package/dist/errors/circuit-breaker.d.ts +53 -0
- package/dist/errors/circuit-breaker.d.ts.map +1 -0
- package/dist/errors/circuit-breaker.js +241 -0
- package/dist/errors/circuit-breaker.js.map +1 -0
- package/dist/errors/error-codes.d.ts +73 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +211 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/error-logging.d.ts +73 -0
- package/dist/errors/error-logging.d.ts.map +1 -0
- package/dist/errors/error-logging.js +256 -0
- package/dist/errors/error-logging.js.map +1 -0
- package/dist/errors/error-propagation.d.ts +73 -0
- package/dist/errors/error-propagation.d.ts.map +1 -0
- package/dist/errors/error-propagation.js +244 -0
- package/dist/errors/error-propagation.js.map +1 -0
- package/dist/errors/exception-hierarchy.d.ts +75 -0
- package/dist/errors/exception-hierarchy.d.ts.map +1 -0
- package/dist/errors/exception-hierarchy.js +259 -0
- package/dist/errors/exception-hierarchy.js.map +1 -0
- package/dist/errors/index.d.ts +31 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +49 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/try-catch-placement.d.ts +73 -0
- package/dist/errors/try-catch-placement.d.ts.map +1 -0
- package/dist/errors/try-catch-placement.js +214 -0
- package/dist/errors/try-catch-placement.js.map +1 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/context-fields.d.ts +48 -0
- package/dist/logging/context-fields.d.ts.map +1 -0
- package/dist/logging/context-fields.js +160 -0
- package/dist/logging/context-fields.js.map +1 -0
- package/dist/logging/correlation-ids.d.ts +44 -0
- package/dist/logging/correlation-ids.d.ts.map +1 -0
- package/dist/logging/correlation-ids.js +144 -0
- package/dist/logging/correlation-ids.js.map +1 -0
- package/dist/logging/health-checks.d.ts +45 -0
- package/dist/logging/health-checks.d.ts.map +1 -0
- package/dist/logging/health-checks.js +165 -0
- package/dist/logging/health-checks.js.map +1 -0
- package/dist/logging/index.d.ts +31 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +49 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/log-levels.d.ts +46 -0
- package/dist/logging/log-levels.d.ts.map +1 -0
- package/dist/logging/log-levels.js +178 -0
- package/dist/logging/log-levels.js.map +1 -0
- package/dist/logging/metric-naming.d.ts +46 -0
- package/dist/logging/metric-naming.d.ts.map +1 -0
- package/dist/logging/metric-naming.js +157 -0
- package/dist/logging/metric-naming.js.map +1 -0
- package/dist/logging/pii-redaction.d.ts +44 -0
- package/dist/logging/pii-redaction.d.ts.map +1 -0
- package/dist/logging/pii-redaction.js +166 -0
- package/dist/logging/pii-redaction.js.map +1 -0
- package/dist/logging/structured-format.d.ts +53 -0
- package/dist/logging/structured-format.d.ts.map +1 -0
- package/dist/logging/structured-format.js +235 -0
- package/dist/logging/structured-format.js.map +1 -0
- package/dist/performance/bundle-size.d.ts +79 -0
- package/dist/performance/bundle-size.d.ts.map +1 -0
- package/dist/performance/bundle-size.js +276 -0
- package/dist/performance/bundle-size.js.map +1 -0
- package/dist/performance/caching-patterns.d.ts +78 -0
- package/dist/performance/caching-patterns.d.ts.map +1 -0
- package/dist/performance/caching-patterns.js +257 -0
- package/dist/performance/caching-patterns.js.map +1 -0
- package/dist/performance/code-splitting.d.ts +86 -0
- package/dist/performance/code-splitting.d.ts.map +1 -0
- package/dist/performance/code-splitting.js +447 -0
- package/dist/performance/code-splitting.js.map +1 -0
- package/dist/performance/debounce-throttle.d.ts +75 -0
- package/dist/performance/debounce-throttle.d.ts.map +1 -0
- package/dist/performance/debounce-throttle.js +232 -0
- package/dist/performance/debounce-throttle.js.map +1 -0
- package/dist/performance/index.d.ts +28 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +39 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/lazy-loading.d.ts +75 -0
- package/dist/performance/lazy-loading.d.ts.map +1 -0
- package/dist/performance/lazy-loading.js +233 -0
- package/dist/performance/lazy-loading.js.map +1 -0
- package/dist/performance/memoization.d.ts +75 -0
- package/dist/performance/memoization.d.ts.map +1 -0
- package/dist/performance/memoization.js +251 -0
- package/dist/performance/memoization.js.map +1 -0
- package/dist/registry/detector-registry.d.ts +266 -0
- package/dist/registry/detector-registry.d.ts.map +1 -0
- package/dist/registry/detector-registry.js +526 -0
- package/dist/registry/detector-registry.js.map +1 -0
- package/dist/registry/index.d.ts +10 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +10 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/loader.d.ts +232 -0
- package/dist/registry/loader.d.ts.map +1 -0
- package/dist/registry/loader.js +419 -0
- package/dist/registry/loader.js.map +1 -0
- package/dist/registry/types.d.ts +111 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +19 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/security/csp-headers.d.ts +78 -0
- package/dist/security/csp-headers.d.ts.map +1 -0
- package/dist/security/csp-headers.js +401 -0
- package/dist/security/csp-headers.js.map +1 -0
- package/dist/security/csrf-protection.d.ts +72 -0
- package/dist/security/csrf-protection.d.ts.map +1 -0
- package/dist/security/csrf-protection.js +344 -0
- package/dist/security/csrf-protection.js.map +1 -0
- package/dist/security/index.d.ts +30 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +48 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/input-sanitization.d.ts +74 -0
- package/dist/security/input-sanitization.d.ts.map +1 -0
- package/dist/security/input-sanitization.js +373 -0
- package/dist/security/input-sanitization.js.map +1 -0
- package/dist/security/rate-limiting.d.ts +81 -0
- package/dist/security/rate-limiting.d.ts.map +1 -0
- package/dist/security/rate-limiting.js +535 -0
- package/dist/security/rate-limiting.js.map +1 -0
- package/dist/security/secret-management.d.ts +83 -0
- package/dist/security/secret-management.d.ts.map +1 -0
- package/dist/security/secret-management.js +547 -0
- package/dist/security/secret-management.js.map +1 -0
- package/dist/security/sql-injection.d.ts +76 -0
- package/dist/security/sql-injection.d.ts.map +1 -0
- package/dist/security/sql-injection.js +383 -0
- package/dist/security/sql-injection.js.map +1 -0
- package/dist/security/xss-prevention.d.ts +80 -0
- package/dist/security/xss-prevention.d.ts.map +1 -0
- package/dist/security/xss-prevention.js +416 -0
- package/dist/security/xss-prevention.js.map +1 -0
- package/dist/structural/barrel-exports.d.ts +178 -0
- package/dist/structural/barrel-exports.d.ts.map +1 -0
- package/dist/structural/barrel-exports.js +553 -0
- package/dist/structural/barrel-exports.js.map +1 -0
- package/dist/structural/circular-deps.d.ts +140 -0
- package/dist/structural/circular-deps.d.ts.map +1 -0
- package/dist/structural/circular-deps.js +422 -0
- package/dist/structural/circular-deps.js.map +1 -0
- package/dist/structural/co-location.d.ts +202 -0
- package/dist/structural/co-location.d.ts.map +1 -0
- package/dist/structural/co-location.js +640 -0
- package/dist/structural/co-location.js.map +1 -0
- package/dist/structural/directory-structure.d.ts +151 -0
- package/dist/structural/directory-structure.d.ts.map +1 -0
- package/dist/structural/directory-structure.js +457 -0
- package/dist/structural/directory-structure.js.map +1 -0
- package/dist/structural/file-naming.d.ts +61 -0
- package/dist/structural/file-naming.d.ts.map +1 -0
- package/dist/structural/file-naming.js +231 -0
- package/dist/structural/file-naming.js.map +1 -0
- package/dist/structural/import-ordering.d.ts +212 -0
- package/dist/structural/import-ordering.d.ts.map +1 -0
- package/dist/structural/import-ordering.js +821 -0
- package/dist/structural/import-ordering.js.map +1 -0
- package/dist/structural/index.d.ts +23 -0
- package/dist/structural/index.d.ts.map +1 -0
- package/dist/structural/index.js +26 -0
- package/dist/structural/index.js.map +1 -0
- package/dist/structural/module-boundaries.d.ts +164 -0
- package/dist/structural/module-boundaries.d.ts.map +1 -0
- package/dist/structural/module-boundaries.js +616 -0
- package/dist/structural/module-boundaries.js.map +1 -0
- package/dist/structural/package-boundaries.d.ts +182 -0
- package/dist/structural/package-boundaries.d.ts.map +1 -0
- package/dist/structural/package-boundaries.js +602 -0
- package/dist/structural/package-boundaries.js.map +1 -0
- package/dist/styling/class-naming.d.ts +263 -0
- package/dist/styling/class-naming.d.ts.map +1 -0
- package/dist/styling/class-naming.js +892 -0
- package/dist/styling/class-naming.js.map +1 -0
- package/dist/styling/color-usage.d.ts +213 -0
- package/dist/styling/color-usage.d.ts.map +1 -0
- package/dist/styling/color-usage.js +732 -0
- package/dist/styling/color-usage.js.map +1 -0
- package/dist/styling/design-tokens.d.ts +212 -0
- package/dist/styling/design-tokens.d.ts.map +1 -0
- package/dist/styling/design-tokens.js +748 -0
- package/dist/styling/design-tokens.js.map +1 -0
- package/dist/styling/index.d.ts +16 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +56 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/responsive.d.ts +304 -0
- package/dist/styling/responsive.d.ts.map +1 -0
- package/dist/styling/responsive.js +888 -0
- package/dist/styling/responsive.js.map +1 -0
- package/dist/styling/spacing-scale.d.ts +248 -0
- package/dist/styling/spacing-scale.d.ts.map +1 -0
- package/dist/styling/spacing-scale.js +865 -0
- package/dist/styling/spacing-scale.js.map +1 -0
- package/dist/styling/tailwind-patterns.d.ts +305 -0
- package/dist/styling/tailwind-patterns.d.ts.map +1 -0
- package/dist/styling/tailwind-patterns.js +1181 -0
- package/dist/styling/tailwind-patterns.js.map +1 -0
- package/dist/styling/typography.d.ts +281 -0
- package/dist/styling/typography.d.ts.map +1 -0
- package/dist/styling/typography.js +1004 -0
- package/dist/styling/typography.js.map +1 -0
- package/dist/styling/z-index-scale.d.ts +270 -0
- package/dist/styling/z-index-scale.d.ts.map +1 -0
- package/dist/styling/z-index-scale.js +714 -0
- package/dist/styling/z-index-scale.js.map +1 -0
- package/dist/testing/co-location.d.ts +42 -0
- package/dist/testing/co-location.d.ts.map +1 -0
- package/dist/testing/co-location.js +134 -0
- package/dist/testing/co-location.js.map +1 -0
- package/dist/testing/describe-naming.d.ts +47 -0
- package/dist/testing/describe-naming.d.ts.map +1 -0
- package/dist/testing/describe-naming.js +150 -0
- package/dist/testing/describe-naming.js.map +1 -0
- package/dist/testing/file-naming.d.ts +44 -0
- package/dist/testing/file-naming.d.ts.map +1 -0
- package/dist/testing/file-naming.js +131 -0
- package/dist/testing/file-naming.js.map +1 -0
- package/dist/testing/fixture-patterns.d.ts +52 -0
- package/dist/testing/fixture-patterns.d.ts.map +1 -0
- package/dist/testing/fixture-patterns.js +228 -0
- package/dist/testing/fixture-patterns.js.map +1 -0
- package/dist/testing/index.d.ts +31 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +49 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-patterns.d.ts +53 -0
- package/dist/testing/mock-patterns.d.ts.map +1 -0
- package/dist/testing/mock-patterns.js +264 -0
- package/dist/testing/mock-patterns.js.map +1 -0
- package/dist/testing/setup-teardown.d.ts +55 -0
- package/dist/testing/setup-teardown.d.ts.map +1 -0
- package/dist/testing/setup-teardown.js +262 -0
- package/dist/testing/setup-teardown.js.map +1 -0
- package/dist/testing/test-structure.d.ts +51 -0
- package/dist/testing/test-structure.d.ts.map +1 -0
- package/dist/testing/test-structure.js +225 -0
- package/dist/testing/test-structure.js.map +1 -0
- package/dist/types/any-usage.d.ts +99 -0
- package/dist/types/any-usage.d.ts.map +1 -0
- package/dist/types/any-usage.js +641 -0
- package/dist/types/any-usage.js.map +1 -0
- package/dist/types/file-location.d.ts +76 -0
- package/dist/types/file-location.d.ts.map +1 -0
- package/dist/types/file-location.js +395 -0
- package/dist/types/file-location.js.map +1 -0
- package/dist/types/generic-patterns.d.ts +97 -0
- package/dist/types/generic-patterns.d.ts.map +1 -0
- package/dist/types/generic-patterns.js +615 -0
- package/dist/types/generic-patterns.js.map +1 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +43 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface-vs-type.d.ts +81 -0
- package/dist/types/interface-vs-type.d.ts.map +1 -0
- package/dist/types/interface-vs-type.js +440 -0
- package/dist/types/interface-vs-type.js.map +1 -0
- package/dist/types/naming-conventions.d.ts +84 -0
- package/dist/types/naming-conventions.d.ts.map +1 -0
- package/dist/types/naming-conventions.js +455 -0
- package/dist/types/naming-conventions.js.map +1 -0
- package/dist/types/type-assertions.d.ts +98 -0
- package/dist/types/type-assertions.d.ts.map +1 -0
- package/dist/types/type-assertions.js +639 -0
- package/dist/types/type-assertions.js.map +1 -0
- package/dist/types/utility-types.d.ts +110 -0
- package/dist/types/utility-types.d.ts.map +1 -0
- package/dist/types/utility-types.js +547 -0
- package/dist/types/utility-types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async Errors Detector - Async error handling pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects async error handling patterns including:
|
|
5
|
+
* - Async/await try/catch
|
|
6
|
+
* - Promise .catch() handlers
|
|
7
|
+
* - Unhandled promise rejections
|
|
8
|
+
* - Error boundaries for async operations
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Missing error handling in async functions
|
|
12
|
+
* - Unhandled promise rejections
|
|
13
|
+
* - Missing .catch() on promises
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.5, 12.8 - Async error handling patterns
|
|
16
|
+
*/
|
|
17
|
+
import type { Language } from 'driftdetect-core';
|
|
18
|
+
import { RegexDetector, type DetectionContext, type DetectionResult } from '../base/index.js';
|
|
19
|
+
export type AsyncErrorPatternType = 'async-try-catch' | 'promise-catch' | 'promise-finally' | 'error-boundary';
|
|
20
|
+
export type AsyncErrorViolationType = 'missing-async-catch' | 'unhandled-promise' | 'floating-promise';
|
|
21
|
+
export interface AsyncErrorPatternInfo {
|
|
22
|
+
type: AsyncErrorPatternType;
|
|
23
|
+
file: string;
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
matchedText: string;
|
|
27
|
+
context?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AsyncErrorViolationInfo {
|
|
30
|
+
type: AsyncErrorViolationType;
|
|
31
|
+
file: string;
|
|
32
|
+
line: number;
|
|
33
|
+
column: number;
|
|
34
|
+
endLine: number;
|
|
35
|
+
endColumn: number;
|
|
36
|
+
value: string;
|
|
37
|
+
issue: string;
|
|
38
|
+
suggestedFix?: string;
|
|
39
|
+
lineContent: string;
|
|
40
|
+
}
|
|
41
|
+
export interface AsyncErrorAnalysis {
|
|
42
|
+
patterns: AsyncErrorPatternInfo[];
|
|
43
|
+
violations: AsyncErrorViolationInfo[];
|
|
44
|
+
hasAsyncErrorHandling: boolean;
|
|
45
|
+
hasPromiseCatch: boolean;
|
|
46
|
+
confidence: number;
|
|
47
|
+
}
|
|
48
|
+
export declare const ASYNC_TRY_CATCH_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
|
|
49
|
+
export declare const PROMISE_CATCH_PATTERNS: readonly [RegExp, RegExp, RegExp];
|
|
50
|
+
export declare const PROMISE_FINALLY_PATTERNS: readonly [RegExp, RegExp];
|
|
51
|
+
export declare const ERROR_BOUNDARY_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
52
|
+
export declare const FLOATING_PROMISE_PATTERNS: readonly [RegExp];
|
|
53
|
+
export declare const PYTHON_ASYNC_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
54
|
+
export declare const EXCLUDED_FILE_PATTERNS: RegExp[];
|
|
55
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
56
|
+
export declare function detectAsyncTryCatch(content: string, file: string): AsyncErrorPatternInfo[];
|
|
57
|
+
export declare function detectPromiseCatch(content: string, file: string): AsyncErrorPatternInfo[];
|
|
58
|
+
export declare function detectPromiseFinally(content: string, file: string): AsyncErrorPatternInfo[];
|
|
59
|
+
export declare function detectErrorBoundaries(content: string, file: string): AsyncErrorPatternInfo[];
|
|
60
|
+
export declare function analyzeAsyncErrors(content: string, file: string): AsyncErrorAnalysis;
|
|
61
|
+
export declare class AsyncErrorsDetector extends RegexDetector {
|
|
62
|
+
readonly id = "errors/async-errors";
|
|
63
|
+
readonly name = "Async Errors Detector";
|
|
64
|
+
readonly description = "Detects async error handling patterns";
|
|
65
|
+
readonly category = "errors";
|
|
66
|
+
readonly subcategory = "async";
|
|
67
|
+
readonly supportedLanguages: Language[];
|
|
68
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
69
|
+
generateQuickFix(): null;
|
|
70
|
+
}
|
|
71
|
+
export declare function createAsyncErrorsDetector(): AsyncErrorsDetector;
|
|
72
|
+
//# sourceMappingURL=async-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-errors.d.ts","sourceRoot":"","sources":["../../src/errors/async-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GA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Async/await try/catch
|
|
6
|
+
* - Promise .catch() handlers
|
|
7
|
+
* - Unhandled promise rejections
|
|
8
|
+
* - Error boundaries for async operations
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Missing error handling in async functions
|
|
12
|
+
* - Unhandled promise rejections
|
|
13
|
+
* - Missing .catch() on promises
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.5, 12.8 - Async error handling patterns
|
|
16
|
+
*/
|
|
17
|
+
import { RegexDetector } from '../base/index.js';
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Constants
|
|
20
|
+
// ============================================================================
|
|
21
|
+
export const ASYNC_TRY_CATCH_PATTERNS = [
|
|
22
|
+
// JavaScript/TypeScript
|
|
23
|
+
/async\s+function\s+\w+\s*\([^)]*\)\s*\{[\s\S]*?try\s*\{/gi,
|
|
24
|
+
/async\s+\([^)]*\)\s*=>\s*\{[\s\S]*?try\s*\{/gi,
|
|
25
|
+
/async\s+\w+\s*=\s*async\s*\([^)]*\)\s*=>\s*\{[\s\S]*?try\s*\{/gi,
|
|
26
|
+
// Python
|
|
27
|
+
/async\s+def\s+\w+\s*\([^)]*\)\s*:[\s\S]*?try\s*:/gi,
|
|
28
|
+
];
|
|
29
|
+
export const PROMISE_CATCH_PATTERNS = [
|
|
30
|
+
// JavaScript/TypeScript
|
|
31
|
+
/\.catch\s*\(\s*(?:async\s*)?\(?[^)]*\)?\s*=>/gi,
|
|
32
|
+
/\.catch\s*\(\s*function/gi,
|
|
33
|
+
/\.catch\s*\(\s*\w+\s*\)/gi,
|
|
34
|
+
];
|
|
35
|
+
export const PROMISE_FINALLY_PATTERNS = [
|
|
36
|
+
// JavaScript/TypeScript
|
|
37
|
+
/\.finally\s*\(\s*(?:async\s*)?\(?[^)]*\)?\s*=>/gi,
|
|
38
|
+
/\.finally\s*\(\s*function/gi,
|
|
39
|
+
];
|
|
40
|
+
export const ERROR_BOUNDARY_PATTERNS = [
|
|
41
|
+
// JavaScript/TypeScript (React)
|
|
42
|
+
/ErrorBoundary/gi,
|
|
43
|
+
/componentDidCatch/gi,
|
|
44
|
+
/getDerivedStateFromError/gi,
|
|
45
|
+
// Python (FastAPI/Starlette)
|
|
46
|
+
/exception_handler/gi,
|
|
47
|
+
/@app\.exception_handler/gi,
|
|
48
|
+
/HTTPException/gi,
|
|
49
|
+
];
|
|
50
|
+
export const FLOATING_PROMISE_PATTERNS = [
|
|
51
|
+
/^\s*\w+\.\w+\s*\([^)]*\)\s*;?\s*$/gim,
|
|
52
|
+
];
|
|
53
|
+
// Python-specific async patterns
|
|
54
|
+
export const PYTHON_ASYNC_PATTERNS = [
|
|
55
|
+
/async\s+def\s+\w+/gi,
|
|
56
|
+
/await\s+\w+/gi,
|
|
57
|
+
/asyncio\.gather/gi,
|
|
58
|
+
/asyncio\.create_task/gi,
|
|
59
|
+
/async\s+with\s+/gi,
|
|
60
|
+
/async\s+for\s+/gi,
|
|
61
|
+
];
|
|
62
|
+
export const EXCLUDED_FILE_PATTERNS = [
|
|
63
|
+
/\.test\.[jt]sx?$/,
|
|
64
|
+
/\.spec\.[jt]sx?$/,
|
|
65
|
+
/node_modules\//,
|
|
66
|
+
/\.d\.ts$/,
|
|
67
|
+
];
|
|
68
|
+
// ============================================================================
|
|
69
|
+
// Helper Functions
|
|
70
|
+
// ============================================================================
|
|
71
|
+
export function shouldExcludeFile(filePath) {
|
|
72
|
+
return EXCLUDED_FILE_PATTERNS.some(p => p.test(filePath));
|
|
73
|
+
}
|
|
74
|
+
function isInsideComment(content, index) {
|
|
75
|
+
const before = content.slice(0, index);
|
|
76
|
+
const lastNewline = before.lastIndexOf('\n');
|
|
77
|
+
const line = before.slice(lastNewline + 1);
|
|
78
|
+
if (line.includes('//') && index - lastNewline - 1 > line.indexOf('//'))
|
|
79
|
+
return true;
|
|
80
|
+
return before.lastIndexOf('/*') > before.lastIndexOf('*/');
|
|
81
|
+
}
|
|
82
|
+
function getPosition(content, index) {
|
|
83
|
+
const before = content.slice(0, index);
|
|
84
|
+
return { line: before.split('\n').length, column: index - before.lastIndexOf('\n') };
|
|
85
|
+
}
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// Detection Functions
|
|
88
|
+
// ============================================================================
|
|
89
|
+
export function detectAsyncTryCatch(content, file) {
|
|
90
|
+
const results = [];
|
|
91
|
+
const lines = content.split('\n');
|
|
92
|
+
for (const pattern of ASYNC_TRY_CATCH_PATTERNS) {
|
|
93
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
94
|
+
let match;
|
|
95
|
+
while ((match = regex.exec(content)) !== null) {
|
|
96
|
+
if (isInsideComment(content, match.index))
|
|
97
|
+
continue;
|
|
98
|
+
const { line, column } = getPosition(content, match.index);
|
|
99
|
+
results.push({
|
|
100
|
+
type: 'async-try-catch',
|
|
101
|
+
file, line, column,
|
|
102
|
+
matchedText: match[0].slice(0, 50) + '...',
|
|
103
|
+
context: lines[line - 1] || '',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return results;
|
|
108
|
+
}
|
|
109
|
+
export function detectPromiseCatch(content, file) {
|
|
110
|
+
const results = [];
|
|
111
|
+
const lines = content.split('\n');
|
|
112
|
+
for (const pattern of PROMISE_CATCH_PATTERNS) {
|
|
113
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
114
|
+
let match;
|
|
115
|
+
while ((match = regex.exec(content)) !== null) {
|
|
116
|
+
if (isInsideComment(content, match.index))
|
|
117
|
+
continue;
|
|
118
|
+
const { line, column } = getPosition(content, match.index);
|
|
119
|
+
results.push({
|
|
120
|
+
type: 'promise-catch',
|
|
121
|
+
file, line, column,
|
|
122
|
+
matchedText: match[0],
|
|
123
|
+
context: lines[line - 1] || '',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return results;
|
|
128
|
+
}
|
|
129
|
+
export function detectPromiseFinally(content, file) {
|
|
130
|
+
const results = [];
|
|
131
|
+
const lines = content.split('\n');
|
|
132
|
+
for (const pattern of PROMISE_FINALLY_PATTERNS) {
|
|
133
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
134
|
+
let match;
|
|
135
|
+
while ((match = regex.exec(content)) !== null) {
|
|
136
|
+
if (isInsideComment(content, match.index))
|
|
137
|
+
continue;
|
|
138
|
+
const { line, column } = getPosition(content, match.index);
|
|
139
|
+
results.push({
|
|
140
|
+
type: 'promise-finally',
|
|
141
|
+
file, line, column,
|
|
142
|
+
matchedText: match[0],
|
|
143
|
+
context: lines[line - 1] || '',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return results;
|
|
148
|
+
}
|
|
149
|
+
export function detectErrorBoundaries(content, file) {
|
|
150
|
+
const results = [];
|
|
151
|
+
const lines = content.split('\n');
|
|
152
|
+
for (const pattern of ERROR_BOUNDARY_PATTERNS) {
|
|
153
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
154
|
+
let match;
|
|
155
|
+
while ((match = regex.exec(content)) !== null) {
|
|
156
|
+
if (isInsideComment(content, match.index))
|
|
157
|
+
continue;
|
|
158
|
+
const { line, column } = getPosition(content, match.index);
|
|
159
|
+
results.push({
|
|
160
|
+
type: 'error-boundary',
|
|
161
|
+
file, line, column,
|
|
162
|
+
matchedText: match[0],
|
|
163
|
+
context: lines[line - 1] || '',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return results;
|
|
168
|
+
}
|
|
169
|
+
// ============================================================================
|
|
170
|
+
// Main Analysis Function
|
|
171
|
+
// ============================================================================
|
|
172
|
+
export function analyzeAsyncErrors(content, file) {
|
|
173
|
+
if (shouldExcludeFile(file)) {
|
|
174
|
+
return { patterns: [], violations: [], hasAsyncErrorHandling: false, hasPromiseCatch: false, confidence: 1.0 };
|
|
175
|
+
}
|
|
176
|
+
const asyncTryCatch = detectAsyncTryCatch(content, file);
|
|
177
|
+
const promiseCatch = detectPromiseCatch(content, file);
|
|
178
|
+
const promiseFinally = detectPromiseFinally(content, file);
|
|
179
|
+
const errorBoundaries = detectErrorBoundaries(content, file);
|
|
180
|
+
const allPatterns = [...asyncTryCatch, ...promiseCatch, ...promiseFinally, ...errorBoundaries];
|
|
181
|
+
const confidence = allPatterns.length > 0 ? 0.85 : 1.0;
|
|
182
|
+
return {
|
|
183
|
+
patterns: allPatterns,
|
|
184
|
+
violations: [],
|
|
185
|
+
hasAsyncErrorHandling: asyncTryCatch.length > 0,
|
|
186
|
+
hasPromiseCatch: promiseCatch.length > 0,
|
|
187
|
+
confidence,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
// ============================================================================
|
|
191
|
+
// Detector Class
|
|
192
|
+
// ============================================================================
|
|
193
|
+
export class AsyncErrorsDetector extends RegexDetector {
|
|
194
|
+
id = 'errors/async-errors';
|
|
195
|
+
name = 'Async Errors Detector';
|
|
196
|
+
description = 'Detects async error handling patterns';
|
|
197
|
+
category = 'errors';
|
|
198
|
+
subcategory = 'async';
|
|
199
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
200
|
+
async detect(context) {
|
|
201
|
+
const { content, file } = context;
|
|
202
|
+
if (shouldExcludeFile(file))
|
|
203
|
+
return this.createEmptyResult();
|
|
204
|
+
const analysis = analyzeAsyncErrors(content, file);
|
|
205
|
+
return this.createResult([], [], analysis.confidence);
|
|
206
|
+
}
|
|
207
|
+
generateQuickFix() {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export function createAsyncErrorsDetector() {
|
|
212
|
+
return new AsyncErrorsDetector();
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=async-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-errors.js","sourceRoot":"","sources":["../../src/errors/async-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,aAAa,EAA+C,MAAM,kBAAkB,CAAC;AA+C9F,+EAA+E;AAC/E,YAAY;AAC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
|
|
4
|
+
* Detects circuit breaker patterns including:
|
|
5
|
+
* - Circuit breaker implementations
|
|
6
|
+
* - State management (open/closed/half-open)
|
|
7
|
+
* - Failure threshold configuration
|
|
8
|
+
* - Reset timeout patterns
|
|
9
|
+
*
|
|
10
|
+
* @requirements 12.6 - Circuit breaker patterns
|
|
11
|
+
*/
|
|
12
|
+
import type { Language } from 'driftdetect-core';
|
|
13
|
+
import { RegexDetector, type DetectionContext, type DetectionResult } from '../base/index.js';
|
|
14
|
+
export type CircuitBreakerPatternType = 'circuit-breaker-class' | 'circuit-breaker-lib' | 'state-management' | 'failure-threshold' | 'reset-timeout';
|
|
15
|
+
export interface CircuitBreakerPatternInfo {
|
|
16
|
+
type: CircuitBreakerPatternType;
|
|
17
|
+
file: string;
|
|
18
|
+
line: number;
|
|
19
|
+
column: number;
|
|
20
|
+
matchedText: string;
|
|
21
|
+
context?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CircuitBreakerAnalysis {
|
|
24
|
+
patterns: CircuitBreakerPatternInfo[];
|
|
25
|
+
hasCircuitBreaker: boolean;
|
|
26
|
+
hasStateManagement: boolean;
|
|
27
|
+
confidence: number;
|
|
28
|
+
}
|
|
29
|
+
export declare const CIRCUIT_BREAKER_CLASS_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
30
|
+
export declare const CIRCUIT_BREAKER_LIB_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
31
|
+
export declare const STATE_MANAGEMENT_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
32
|
+
export declare const FAILURE_THRESHOLD_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
33
|
+
export declare const RESET_TIMEOUT_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
34
|
+
export declare const EXCLUDED_FILE_PATTERNS: RegExp[];
|
|
35
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
36
|
+
export declare function detectCircuitBreakerClasses(content: string, file: string): CircuitBreakerPatternInfo[];
|
|
37
|
+
export declare function detectCircuitBreakerLibs(content: string, file: string): CircuitBreakerPatternInfo[];
|
|
38
|
+
export declare function detectStateManagement(content: string, file: string): CircuitBreakerPatternInfo[];
|
|
39
|
+
export declare function detectFailureThreshold(content: string, file: string): CircuitBreakerPatternInfo[];
|
|
40
|
+
export declare function detectResetTimeout(content: string, file: string): CircuitBreakerPatternInfo[];
|
|
41
|
+
export declare function analyzeCircuitBreaker(content: string, file: string): CircuitBreakerAnalysis;
|
|
42
|
+
export declare class CircuitBreakerDetector extends RegexDetector {
|
|
43
|
+
readonly id = "errors/circuit-breaker";
|
|
44
|
+
readonly name = "Circuit Breaker Detector";
|
|
45
|
+
readonly description = "Detects circuit breaker patterns";
|
|
46
|
+
readonly category = "errors";
|
|
47
|
+
readonly subcategory = "resilience";
|
|
48
|
+
readonly supportedLanguages: Language[];
|
|
49
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
50
|
+
generateQuickFix(): null;
|
|
51
|
+
}
|
|
52
|
+
export declare function createCircuitBreakerDetector(): CircuitBreakerDetector;
|
|
53
|
+
//# sourceMappingURL=circuit-breaker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../src/errors/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAM9F,MAAM,MAAM,yBAAyB,GACjC,uBAAuB,GACvB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,eAAe,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,IA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AG,sBAAsB,CAqB3F;AAMD,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,QAAQ,CAAC,EAAE,4BAA4B;IACvC,QAAQ,CAAC,IAAI,8BAA8B;IAC3C,QAAQ,CAAC,WAAW,sCAAsC;IAC1D,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,WAAW,gBAAgB;IACpC,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAA0C;IAE3E,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAQjE,gBAAgB,IAAI,IAAI;CAGzB;AAED,wBAAgB,4BAA4B,IAAI,sBAAsB,CAErE"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Circuit Breaker Detector - Circuit breaker pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects circuit breaker patterns including:
|
|
5
|
+
* - Circuit breaker implementations
|
|
6
|
+
* - State management (open/closed/half-open)
|
|
7
|
+
* - Failure threshold configuration
|
|
8
|
+
* - Reset timeout patterns
|
|
9
|
+
*
|
|
10
|
+
* @requirements 12.6 - Circuit breaker patterns
|
|
11
|
+
*/
|
|
12
|
+
import { RegexDetector } from '../base/index.js';
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Constants
|
|
15
|
+
// ============================================================================
|
|
16
|
+
export const CIRCUIT_BREAKER_CLASS_PATTERNS = [
|
|
17
|
+
// JavaScript/TypeScript
|
|
18
|
+
/class\s+CircuitBreaker/gi,
|
|
19
|
+
/class\s+\w*Breaker\s+/gi,
|
|
20
|
+
/new\s+CircuitBreaker\s*\(/gi,
|
|
21
|
+
// Python
|
|
22
|
+
/class\s+CircuitBreaker\s*\(/gi,
|
|
23
|
+
/CircuitBreaker\s*\(\s*\)/gi,
|
|
24
|
+
];
|
|
25
|
+
export const CIRCUIT_BREAKER_LIB_PATTERNS = [
|
|
26
|
+
// JavaScript/TypeScript
|
|
27
|
+
/cockatiel/gi,
|
|
28
|
+
/opossum/gi,
|
|
29
|
+
/brakes/gi,
|
|
30
|
+
/circuit-breaker/gi,
|
|
31
|
+
/circuitBreaker/gi,
|
|
32
|
+
// Python
|
|
33
|
+
/pybreaker/gi,
|
|
34
|
+
/circuitbreaker/gi,
|
|
35
|
+
/from\s+circuitbreaker\s+import/gi,
|
|
36
|
+
];
|
|
37
|
+
export const STATE_MANAGEMENT_PATTERNS = [
|
|
38
|
+
// Both languages
|
|
39
|
+
/(?:state|status)\s*[=:]\s*['"`](?:open|closed|half[_-]?open)['"`]/gi,
|
|
40
|
+
/isOpen|isClosed|isHalfOpen/gi,
|
|
41
|
+
/CircuitState\./gi,
|
|
42
|
+
/BreakerState\./gi,
|
|
43
|
+
// Python
|
|
44
|
+
/is_open|is_closed|is_half_open/gi,
|
|
45
|
+
/circuit_state/gi,
|
|
46
|
+
];
|
|
47
|
+
export const FAILURE_THRESHOLD_PATTERNS = [
|
|
48
|
+
// Both languages
|
|
49
|
+
/failureThreshold\s*[=:]/gi,
|
|
50
|
+
/threshold\s*[=:]\s*\d+/gi,
|
|
51
|
+
/maxFailures\s*[=:]/gi,
|
|
52
|
+
/failureCount/gi,
|
|
53
|
+
// Python
|
|
54
|
+
/failure_threshold\s*[=:]/gi,
|
|
55
|
+
/max_failures\s*[=:]/gi,
|
|
56
|
+
/failure_count/gi,
|
|
57
|
+
];
|
|
58
|
+
export const RESET_TIMEOUT_PATTERNS = [
|
|
59
|
+
// Both languages
|
|
60
|
+
/resetTimeout\s*[=:]/gi,
|
|
61
|
+
/cooldownPeriod\s*[=:]/gi,
|
|
62
|
+
/recoveryTime\s*[=:]/gi,
|
|
63
|
+
/halfOpenAfter\s*[=:]/gi,
|
|
64
|
+
// Python
|
|
65
|
+
/reset_timeout\s*[=:]/gi,
|
|
66
|
+
/cooldown_period\s*[=:]/gi,
|
|
67
|
+
/recovery_time\s*[=:]/gi,
|
|
68
|
+
];
|
|
69
|
+
export const EXCLUDED_FILE_PATTERNS = [
|
|
70
|
+
/\.test\.[jt]sx?$/,
|
|
71
|
+
/\.spec\.[jt]sx?$/,
|
|
72
|
+
/node_modules\//,
|
|
73
|
+
/\.d\.ts$/,
|
|
74
|
+
];
|
|
75
|
+
// ============================================================================
|
|
76
|
+
// Helper Functions
|
|
77
|
+
// ============================================================================
|
|
78
|
+
export function shouldExcludeFile(filePath) {
|
|
79
|
+
return EXCLUDED_FILE_PATTERNS.some(p => p.test(filePath));
|
|
80
|
+
}
|
|
81
|
+
function isInsideComment(content, index) {
|
|
82
|
+
const before = content.slice(0, index);
|
|
83
|
+
const lastNewline = before.lastIndexOf('\n');
|
|
84
|
+
const line = before.slice(lastNewline + 1);
|
|
85
|
+
if (line.includes('//') && index - lastNewline - 1 > line.indexOf('//'))
|
|
86
|
+
return true;
|
|
87
|
+
return before.lastIndexOf('/*') > before.lastIndexOf('*/');
|
|
88
|
+
}
|
|
89
|
+
function getPosition(content, index) {
|
|
90
|
+
const before = content.slice(0, index);
|
|
91
|
+
return { line: before.split('\n').length, column: index - before.lastIndexOf('\n') };
|
|
92
|
+
}
|
|
93
|
+
// ============================================================================
|
|
94
|
+
// Detection Functions
|
|
95
|
+
// ============================================================================
|
|
96
|
+
export function detectCircuitBreakerClasses(content, file) {
|
|
97
|
+
const results = [];
|
|
98
|
+
const lines = content.split('\n');
|
|
99
|
+
for (const pattern of CIRCUIT_BREAKER_CLASS_PATTERNS) {
|
|
100
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
101
|
+
let match;
|
|
102
|
+
while ((match = regex.exec(content)) !== null) {
|
|
103
|
+
if (isInsideComment(content, match.index))
|
|
104
|
+
continue;
|
|
105
|
+
const { line, column } = getPosition(content, match.index);
|
|
106
|
+
results.push({
|
|
107
|
+
type: 'circuit-breaker-class',
|
|
108
|
+
file, line, column,
|
|
109
|
+
matchedText: match[0],
|
|
110
|
+
context: lines[line - 1] || '',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return results;
|
|
115
|
+
}
|
|
116
|
+
export function detectCircuitBreakerLibs(content, file) {
|
|
117
|
+
const results = [];
|
|
118
|
+
const lines = content.split('\n');
|
|
119
|
+
for (const pattern of CIRCUIT_BREAKER_LIB_PATTERNS) {
|
|
120
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
121
|
+
let match;
|
|
122
|
+
while ((match = regex.exec(content)) !== null) {
|
|
123
|
+
if (isInsideComment(content, match.index))
|
|
124
|
+
continue;
|
|
125
|
+
const { line, column } = getPosition(content, match.index);
|
|
126
|
+
results.push({
|
|
127
|
+
type: 'circuit-breaker-lib',
|
|
128
|
+
file, line, column,
|
|
129
|
+
matchedText: match[0],
|
|
130
|
+
context: lines[line - 1] || '',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return results;
|
|
135
|
+
}
|
|
136
|
+
export function detectStateManagement(content, file) {
|
|
137
|
+
const results = [];
|
|
138
|
+
const lines = content.split('\n');
|
|
139
|
+
for (const pattern of STATE_MANAGEMENT_PATTERNS) {
|
|
140
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
141
|
+
let match;
|
|
142
|
+
while ((match = regex.exec(content)) !== null) {
|
|
143
|
+
if (isInsideComment(content, match.index))
|
|
144
|
+
continue;
|
|
145
|
+
const { line, column } = getPosition(content, match.index);
|
|
146
|
+
results.push({
|
|
147
|
+
type: 'state-management',
|
|
148
|
+
file, line, column,
|
|
149
|
+
matchedText: match[0],
|
|
150
|
+
context: lines[line - 1] || '',
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return results;
|
|
155
|
+
}
|
|
156
|
+
export function detectFailureThreshold(content, file) {
|
|
157
|
+
const results = [];
|
|
158
|
+
const lines = content.split('\n');
|
|
159
|
+
for (const pattern of FAILURE_THRESHOLD_PATTERNS) {
|
|
160
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
161
|
+
let match;
|
|
162
|
+
while ((match = regex.exec(content)) !== null) {
|
|
163
|
+
if (isInsideComment(content, match.index))
|
|
164
|
+
continue;
|
|
165
|
+
const { line, column } = getPosition(content, match.index);
|
|
166
|
+
results.push({
|
|
167
|
+
type: 'failure-threshold',
|
|
168
|
+
file, line, column,
|
|
169
|
+
matchedText: match[0],
|
|
170
|
+
context: lines[line - 1] || '',
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return results;
|
|
175
|
+
}
|
|
176
|
+
export function detectResetTimeout(content, file) {
|
|
177
|
+
const results = [];
|
|
178
|
+
const lines = content.split('\n');
|
|
179
|
+
for (const pattern of RESET_TIMEOUT_PATTERNS) {
|
|
180
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
181
|
+
let match;
|
|
182
|
+
while ((match = regex.exec(content)) !== null) {
|
|
183
|
+
if (isInsideComment(content, match.index))
|
|
184
|
+
continue;
|
|
185
|
+
const { line, column } = getPosition(content, match.index);
|
|
186
|
+
results.push({
|
|
187
|
+
type: 'reset-timeout',
|
|
188
|
+
file, line, column,
|
|
189
|
+
matchedText: match[0],
|
|
190
|
+
context: lines[line - 1] || '',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return results;
|
|
195
|
+
}
|
|
196
|
+
// ============================================================================
|
|
197
|
+
// Main Analysis Function
|
|
198
|
+
// ============================================================================
|
|
199
|
+
export function analyzeCircuitBreaker(content, file) {
|
|
200
|
+
if (shouldExcludeFile(file)) {
|
|
201
|
+
return { patterns: [], hasCircuitBreaker: false, hasStateManagement: false, confidence: 1.0 };
|
|
202
|
+
}
|
|
203
|
+
const classes = detectCircuitBreakerClasses(content, file);
|
|
204
|
+
const libs = detectCircuitBreakerLibs(content, file);
|
|
205
|
+
const state = detectStateManagement(content, file);
|
|
206
|
+
const threshold = detectFailureThreshold(content, file);
|
|
207
|
+
const timeout = detectResetTimeout(content, file);
|
|
208
|
+
const allPatterns = [...classes, ...libs, ...state, ...threshold, ...timeout];
|
|
209
|
+
const confidence = allPatterns.length > 0 ? 0.85 : 1.0;
|
|
210
|
+
return {
|
|
211
|
+
patterns: allPatterns,
|
|
212
|
+
hasCircuitBreaker: classes.length > 0 || libs.length > 0,
|
|
213
|
+
hasStateManagement: state.length > 0,
|
|
214
|
+
confidence,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
// ============================================================================
|
|
218
|
+
// Detector Class
|
|
219
|
+
// ============================================================================
|
|
220
|
+
export class CircuitBreakerDetector extends RegexDetector {
|
|
221
|
+
id = 'errors/circuit-breaker';
|
|
222
|
+
name = 'Circuit Breaker Detector';
|
|
223
|
+
description = 'Detects circuit breaker patterns';
|
|
224
|
+
category = 'errors';
|
|
225
|
+
subcategory = 'resilience';
|
|
226
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
227
|
+
async detect(context) {
|
|
228
|
+
const { content, file } = context;
|
|
229
|
+
if (shouldExcludeFile(file))
|
|
230
|
+
return this.createEmptyResult();
|
|
231
|
+
const analysis = analyzeCircuitBreaker(content, file);
|
|
232
|
+
return this.createResult([], [], analysis.confidence);
|
|
233
|
+
}
|
|
234
|
+
generateQuickFix() {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
export function createCircuitBreakerDetector() {
|
|
239
|
+
return new CircuitBreakerDetector();
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=circuit-breaker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit-breaker.js","sourceRoot":"","sources":["../../src/errors/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,aAAa,EAA+C,MAAM,kBAAkB,CAAC;AA6B9F,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,wBAAwB;IACxB,0BAA0B;IAC1B,yBAAyB;IACzB,6BAA6B;IAC7B,SAAS;IACT,+BAA+B;I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