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,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Propagation Detector - Error bubbling pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Detects error propagation patterns including:
|
|
5
|
+
* - Error re-throwing patterns
|
|
6
|
+
* - Error wrapping patterns
|
|
7
|
+
* - Error transformation patterns
|
|
8
|
+
* - Error chain preservation
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Lost error context
|
|
12
|
+
* - Missing cause chain
|
|
13
|
+
* - Inconsistent propagation
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.4 - Error propagation patterns
|
|
16
|
+
*/
|
|
17
|
+
import type { Language } from 'driftdetect-core';
|
|
18
|
+
import { RegexDetector, type DetectionContext, type DetectionResult } from '../base/index.js';
|
|
19
|
+
export type PropagationPatternType = 'rethrow' | 'wrap-rethrow' | 'transform' | 'chain-preserve';
|
|
20
|
+
export type PropagationViolationType = 'lost-context' | 'missing-cause' | 'swallowed-error';
|
|
21
|
+
export interface PropagationPatternInfo {
|
|
22
|
+
type: PropagationPatternType;
|
|
23
|
+
file: string;
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
matchedText: string;
|
|
27
|
+
preservesCause?: boolean;
|
|
28
|
+
context?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PropagationViolationInfo {
|
|
31
|
+
type: PropagationViolationType;
|
|
32
|
+
file: string;
|
|
33
|
+
line: number;
|
|
34
|
+
column: number;
|
|
35
|
+
endLine: number;
|
|
36
|
+
endColumn: number;
|
|
37
|
+
value: string;
|
|
38
|
+
issue: string;
|
|
39
|
+
suggestedFix?: string;
|
|
40
|
+
lineContent: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PropagationAnalysis {
|
|
43
|
+
patterns: PropagationPatternInfo[];
|
|
44
|
+
violations: PropagationViolationInfo[];
|
|
45
|
+
hasRethrow: boolean;
|
|
46
|
+
preservesCause: boolean;
|
|
47
|
+
confidence: number;
|
|
48
|
+
}
|
|
49
|
+
export declare const RETHROW_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
50
|
+
export declare const WRAP_RETHROW_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
|
|
51
|
+
export declare const TRANSFORM_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
|
|
52
|
+
export declare const CHAIN_PRESERVE_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
53
|
+
export declare const LOST_CONTEXT_PATTERNS: readonly [RegExp, RegExp];
|
|
54
|
+
export declare const EXCLUDED_FILE_PATTERNS: RegExp[];
|
|
55
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
56
|
+
export declare function detectRethrowPatterns(content: string, file: string): PropagationPatternInfo[];
|
|
57
|
+
export declare function detectWrapRethrowPatterns(content: string, file: string): PropagationPatternInfo[];
|
|
58
|
+
export declare function detectTransformPatterns(content: string, file: string): PropagationPatternInfo[];
|
|
59
|
+
export declare function detectChainPreservePatterns(content: string, file: string): PropagationPatternInfo[];
|
|
60
|
+
export declare function detectLostContextViolations(content: string, file: string): PropagationViolationInfo[];
|
|
61
|
+
export declare function analyzeErrorPropagation(content: string, file: string): PropagationAnalysis;
|
|
62
|
+
export declare class ErrorPropagationDetector extends RegexDetector {
|
|
63
|
+
readonly id = "errors/error-propagation";
|
|
64
|
+
readonly name = "Error Propagation Detector";
|
|
65
|
+
readonly description = "Detects error propagation and bubbling patterns";
|
|
66
|
+
readonly category = "errors";
|
|
67
|
+
readonly subcategory = "propagation";
|
|
68
|
+
readonly supportedLanguages: Language[];
|
|
69
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
70
|
+
generateQuickFix(): null;
|
|
71
|
+
}
|
|
72
|
+
export declare function createErrorPropagationDetector(): ErrorPropagationDetector;
|
|
73
|
+
//# sourceMappingURL=error-propagation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-propagation.d.ts","sourceRoot":"","sources":["../../src/errors/error-propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE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4
|
+
* Detects error propagation patterns including:
|
|
5
|
+
* - Error re-throwing patterns
|
|
6
|
+
* - Error wrapping patterns
|
|
7
|
+
* - Error transformation patterns
|
|
8
|
+
* - Error chain preservation
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Lost error context
|
|
12
|
+
* - Missing cause chain
|
|
13
|
+
* - Inconsistent propagation
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.4 - Error propagation patterns
|
|
16
|
+
*/
|
|
17
|
+
import { RegexDetector } from '../base/index.js';
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Constants
|
|
20
|
+
// ============================================================================
|
|
21
|
+
export const RETHROW_PATTERNS = [
|
|
22
|
+
// JavaScript/TypeScript
|
|
23
|
+
/throw\s+\w+;/gi,
|
|
24
|
+
/throw\s+error;/gi,
|
|
25
|
+
/throw\s+err;/gi,
|
|
26
|
+
/throw\s+e;/gi,
|
|
27
|
+
// Python
|
|
28
|
+
/raise\s+\w+\s*$/gim,
|
|
29
|
+
/raise\s+e\s*$/gim,
|
|
30
|
+
/raise\s*$/gim, // bare raise
|
|
31
|
+
];
|
|
32
|
+
export const WRAP_RETHROW_PATTERNS = [
|
|
33
|
+
// JavaScript/TypeScript
|
|
34
|
+
/throw\s+new\s+\w+Error\s*\([^)]*,\s*\{\s*cause/gi,
|
|
35
|
+
/throw\s+new\s+\w+\s*\([^)]*,\s*\{\s*cause/gi,
|
|
36
|
+
/throw\s+new\s+Error\s*\([^)]*,\s*\{\s*cause/gi,
|
|
37
|
+
// Python - raise from
|
|
38
|
+
/raise\s+\w+\s*\([^)]*\)\s+from\s+\w+/gi,
|
|
39
|
+
];
|
|
40
|
+
export const TRANSFORM_PATTERNS = [
|
|
41
|
+
// JavaScript/TypeScript
|
|
42
|
+
/throw\s+new\s+\w+Error\s*\(\s*\w+\.message/gi,
|
|
43
|
+
/throw\s+new\s+\w+\s*\(\s*\w+\.message/gi,
|
|
44
|
+
/throw\s+\w+Error\.from\s*\(/gi,
|
|
45
|
+
// Python
|
|
46
|
+
/raise\s+\w+\s*\(\s*str\s*\(\s*\w+\s*\)/gi,
|
|
47
|
+
];
|
|
48
|
+
export const CHAIN_PRESERVE_PATTERNS = [
|
|
49
|
+
// JavaScript/TypeScript
|
|
50
|
+
/cause\s*:\s*\w+/gi,
|
|
51
|
+
/\.cause\s*=\s*\w+/gi,
|
|
52
|
+
/originalError\s*:\s*\w+/gi,
|
|
53
|
+
/innerException\s*:\s*\w+/gi,
|
|
54
|
+
// Python
|
|
55
|
+
/from\s+\w+\s*$/gim,
|
|
56
|
+
/__cause__\s*=/gi,
|
|
57
|
+
/original_error\s*=/gi,
|
|
58
|
+
];
|
|
59
|
+
export const LOST_CONTEXT_PATTERNS = [
|
|
60
|
+
// JavaScript/TypeScript
|
|
61
|
+
/catch\s*\([^)]*\)\s*\{[^}]*throw\s+new\s+Error\s*\(\s*['"`][^'"]+['"`]\s*\)/gi,
|
|
62
|
+
// Python - raise without from
|
|
63
|
+
/except[^:]*:\s*\n[^r]*raise\s+\w+\s*\([^)]*\)\s*(?!from)/gi,
|
|
64
|
+
];
|
|
65
|
+
export const EXCLUDED_FILE_PATTERNS = [
|
|
66
|
+
/\.test\.[jt]sx?$/,
|
|
67
|
+
/\.spec\.[jt]sx?$/,
|
|
68
|
+
/node_modules\//,
|
|
69
|
+
/\.d\.ts$/,
|
|
70
|
+
];
|
|
71
|
+
// ============================================================================
|
|
72
|
+
// Helper Functions
|
|
73
|
+
// ============================================================================
|
|
74
|
+
export function shouldExcludeFile(filePath) {
|
|
75
|
+
return EXCLUDED_FILE_PATTERNS.some(p => p.test(filePath));
|
|
76
|
+
}
|
|
77
|
+
function isInsideComment(content, index) {
|
|
78
|
+
const before = content.slice(0, index);
|
|
79
|
+
const lastNewline = before.lastIndexOf('\n');
|
|
80
|
+
const line = before.slice(lastNewline + 1);
|
|
81
|
+
if (line.includes('//') && index - lastNewline - 1 > line.indexOf('//'))
|
|
82
|
+
return true;
|
|
83
|
+
return before.lastIndexOf('/*') > before.lastIndexOf('*/');
|
|
84
|
+
}
|
|
85
|
+
function getPosition(content, index) {
|
|
86
|
+
const before = content.slice(0, index);
|
|
87
|
+
return { line: before.split('\n').length, column: index - before.lastIndexOf('\n') };
|
|
88
|
+
}
|
|
89
|
+
// ============================================================================
|
|
90
|
+
// Detection Functions
|
|
91
|
+
// ============================================================================
|
|
92
|
+
export function detectRethrowPatterns(content, file) {
|
|
93
|
+
const results = [];
|
|
94
|
+
const lines = content.split('\n');
|
|
95
|
+
for (const pattern of RETHROW_PATTERNS) {
|
|
96
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
97
|
+
let match;
|
|
98
|
+
while ((match = regex.exec(content)) !== null) {
|
|
99
|
+
if (isInsideComment(content, match.index))
|
|
100
|
+
continue;
|
|
101
|
+
const { line, column } = getPosition(content, match.index);
|
|
102
|
+
results.push({
|
|
103
|
+
type: 'rethrow',
|
|
104
|
+
file, line, column,
|
|
105
|
+
matchedText: match[0],
|
|
106
|
+
context: lines[line - 1] || '',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return results;
|
|
111
|
+
}
|
|
112
|
+
export function detectWrapRethrowPatterns(content, file) {
|
|
113
|
+
const results = [];
|
|
114
|
+
const lines = content.split('\n');
|
|
115
|
+
for (const pattern of WRAP_RETHROW_PATTERNS) {
|
|
116
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
117
|
+
let match;
|
|
118
|
+
while ((match = regex.exec(content)) !== null) {
|
|
119
|
+
if (isInsideComment(content, match.index))
|
|
120
|
+
continue;
|
|
121
|
+
const { line, column } = getPosition(content, match.index);
|
|
122
|
+
results.push({
|
|
123
|
+
type: 'wrap-rethrow',
|
|
124
|
+
file, line, column,
|
|
125
|
+
matchedText: match[0],
|
|
126
|
+
preservesCause: true,
|
|
127
|
+
context: lines[line - 1] || '',
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return results;
|
|
132
|
+
}
|
|
133
|
+
export function detectTransformPatterns(content, file) {
|
|
134
|
+
const results = [];
|
|
135
|
+
const lines = content.split('\n');
|
|
136
|
+
for (const pattern of TRANSFORM_PATTERNS) {
|
|
137
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
138
|
+
let match;
|
|
139
|
+
while ((match = regex.exec(content)) !== null) {
|
|
140
|
+
if (isInsideComment(content, match.index))
|
|
141
|
+
continue;
|
|
142
|
+
const { line, column } = getPosition(content, match.index);
|
|
143
|
+
results.push({
|
|
144
|
+
type: 'transform',
|
|
145
|
+
file, line, column,
|
|
146
|
+
matchedText: match[0],
|
|
147
|
+
context: lines[line - 1] || '',
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return results;
|
|
152
|
+
}
|
|
153
|
+
export function detectChainPreservePatterns(content, file) {
|
|
154
|
+
const results = [];
|
|
155
|
+
const lines = content.split('\n');
|
|
156
|
+
for (const pattern of CHAIN_PRESERVE_PATTERNS) {
|
|
157
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
158
|
+
let match;
|
|
159
|
+
while ((match = regex.exec(content)) !== null) {
|
|
160
|
+
if (isInsideComment(content, match.index))
|
|
161
|
+
continue;
|
|
162
|
+
const { line, column } = getPosition(content, match.index);
|
|
163
|
+
results.push({
|
|
164
|
+
type: 'chain-preserve',
|
|
165
|
+
file, line, column,
|
|
166
|
+
matchedText: match[0],
|
|
167
|
+
preservesCause: true,
|
|
168
|
+
context: lines[line - 1] || '',
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return results;
|
|
173
|
+
}
|
|
174
|
+
export function detectLostContextViolations(content, file) {
|
|
175
|
+
const violations = [];
|
|
176
|
+
const lines = content.split('\n');
|
|
177
|
+
for (const pattern of LOST_CONTEXT_PATTERNS) {
|
|
178
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
179
|
+
let match;
|
|
180
|
+
while ((match = regex.exec(content)) !== null) {
|
|
181
|
+
if (isInsideComment(content, match.index))
|
|
182
|
+
continue;
|
|
183
|
+
const { line, column } = getPosition(content, match.index);
|
|
184
|
+
violations.push({
|
|
185
|
+
type: 'lost-context',
|
|
186
|
+
file, line, column,
|
|
187
|
+
endLine: line,
|
|
188
|
+
endColumn: column + match[0].length,
|
|
189
|
+
value: match[0].slice(0, 50) + '...',
|
|
190
|
+
issue: 'Error context lost when re-throwing',
|
|
191
|
+
suggestedFix: 'Include original error as cause: { cause: error }',
|
|
192
|
+
lineContent: lines[line - 1] || '',
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return violations;
|
|
197
|
+
}
|
|
198
|
+
// ============================================================================
|
|
199
|
+
// Main Analysis Function
|
|
200
|
+
// ============================================================================
|
|
201
|
+
export function analyzeErrorPropagation(content, file) {
|
|
202
|
+
if (shouldExcludeFile(file)) {
|
|
203
|
+
return { patterns: [], violations: [], hasRethrow: false, preservesCause: false, confidence: 1.0 };
|
|
204
|
+
}
|
|
205
|
+
const rethrow = detectRethrowPatterns(content, file);
|
|
206
|
+
const wrapRethrow = detectWrapRethrowPatterns(content, file);
|
|
207
|
+
const transform = detectTransformPatterns(content, file);
|
|
208
|
+
const chainPreserve = detectChainPreservePatterns(content, file);
|
|
209
|
+
const allPatterns = [...rethrow, ...wrapRethrow, ...transform, ...chainPreserve];
|
|
210
|
+
const violations = detectLostContextViolations(content, file);
|
|
211
|
+
const confidence = allPatterns.length > 0 ? Math.max(0.5, 1 - violations.length * 0.1) : 1.0;
|
|
212
|
+
return {
|
|
213
|
+
patterns: allPatterns,
|
|
214
|
+
violations,
|
|
215
|
+
hasRethrow: rethrow.length > 0,
|
|
216
|
+
preservesCause: wrapRethrow.length > 0 || chainPreserve.length > 0,
|
|
217
|
+
confidence,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
// ============================================================================
|
|
221
|
+
// Detector Class
|
|
222
|
+
// ============================================================================
|
|
223
|
+
export class ErrorPropagationDetector extends RegexDetector {
|
|
224
|
+
id = 'errors/error-propagation';
|
|
225
|
+
name = 'Error Propagation Detector';
|
|
226
|
+
description = 'Detects error propagation and bubbling patterns';
|
|
227
|
+
category = 'errors';
|
|
228
|
+
subcategory = 'propagation';
|
|
229
|
+
supportedLanguages = ['typescript', 'javascript', 'python'];
|
|
230
|
+
async detect(context) {
|
|
231
|
+
const { content, file } = context;
|
|
232
|
+
if (shouldExcludeFile(file))
|
|
233
|
+
return this.createEmptyResult();
|
|
234
|
+
const analysis = analyzeErrorPropagation(content, file);
|
|
235
|
+
return this.createResult([], [], analysis.confidence);
|
|
236
|
+
}
|
|
237
|
+
generateQuickFix() {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
export function createErrorPropagationDetector() {
|
|
242
|
+
return new ErrorPropagationDetector();
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=error-propagation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-propagation.js","sourceRoot":"","sources":["../../src/errors/error-propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,aAAa,EAA+C,MAAM,kBAAkB,CAAC;AAgD9F,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,wBAAwB;IACxB,gBAAgB;IAChB,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,SAAS;IACT,oBAAoB;IACpB,kBAAkB;IAClB,cAAc,EAAG,aAAa;CACtB,CAAC;AAEX,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,wBAAwB;IACxB,kDAAkD;IAClD,6CAA6C;IAC7C,+CAA+C;IAC/C,sBAAsB;IACtB,wCAAwC;CAChC,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,wBAAwB;IACxB,8CAA8C;IAC9C,yCAAyC;IACzC,+BAA+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AAa;IAChD,EAAE,GAAG,0BAA0B,CAAC;IAChC,IAAI,GAAG,4BAA4B,CAAC;IACpC,WAAW,GAAG,iDAAiD,CAAC;IAChE,QAAQ,GAAG,QAAQ,CAAC;IACpB,WAAW,GAAG,aAAa,CAAC;IAC5B,kBAAkB,GAAe,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEjF,KAAK,CAAC,MAAM,CAAC,OAAyB;QACpC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAClC,IAAI,iBAAiB,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAE7D,MAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,UAAU,8BAA8B;IAC5C,OAAO,IAAI,wBAAwB,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exception Hierarchy Detector - Exception taxonomy detection
|
|
3
|
+
*
|
|
4
|
+
* Detects exception hierarchy patterns including:
|
|
5
|
+
* - AppError base class inheritance
|
|
6
|
+
* - Custom error class definitions
|
|
7
|
+
* - Error class naming conventions
|
|
8
|
+
* - Error inheritance chains
|
|
9
|
+
*
|
|
10
|
+
* Flags violations:
|
|
11
|
+
* - Throwing raw Error instead of custom errors
|
|
12
|
+
* - Inconsistent error class naming
|
|
13
|
+
* - Missing error inheritance
|
|
14
|
+
*
|
|
15
|
+
* @requirements 12.1 - Exception hierarchy patterns
|
|
16
|
+
*/
|
|
17
|
+
import type { Language } from 'driftdetect-core';
|
|
18
|
+
import { RegexDetector, type DetectionContext, type DetectionResult } from '../base/index.js';
|
|
19
|
+
export type ExceptionPatternType = 'app-error-class' | 'custom-error-class' | 'error-inheritance' | 'error-factory';
|
|
20
|
+
export type ExceptionViolationType = 'raw-error-throw' | 'inconsistent-naming' | 'missing-inheritance';
|
|
21
|
+
export interface ExceptionPatternInfo {
|
|
22
|
+
type: ExceptionPatternType;
|
|
23
|
+
file: string;
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
matchedText: string;
|
|
27
|
+
className?: string | undefined;
|
|
28
|
+
baseClass?: string | undefined;
|
|
29
|
+
context?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface ExceptionViolationInfo {
|
|
32
|
+
type: ExceptionViolationType;
|
|
33
|
+
file: string;
|
|
34
|
+
line: number;
|
|
35
|
+
column: number;
|
|
36
|
+
endLine: number;
|
|
37
|
+
endColumn: number;
|
|
38
|
+
value: string;
|
|
39
|
+
issue: string;
|
|
40
|
+
suggestedFix?: string;
|
|
41
|
+
lineContent: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ExceptionAnalysis {
|
|
44
|
+
patterns: ExceptionPatternInfo[];
|
|
45
|
+
violations: ExceptionViolationInfo[];
|
|
46
|
+
hasCustomErrors: boolean;
|
|
47
|
+
hasAppError: boolean;
|
|
48
|
+
errorClasses: string[];
|
|
49
|
+
confidence: number;
|
|
50
|
+
}
|
|
51
|
+
export declare const APP_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
52
|
+
export declare const CUSTOM_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
53
|
+
export declare const ERROR_INHERITANCE_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
|
|
54
|
+
export declare const ERROR_FACTORY_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
55
|
+
export declare const RAW_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
56
|
+
export declare const EXCLUDED_FILE_PATTERNS: RegExp[];
|
|
57
|
+
export declare function shouldExcludeFile(filePath: string): boolean;
|
|
58
|
+
export declare function detectAppErrorClasses(content: string, file: string): ExceptionPatternInfo[];
|
|
59
|
+
export declare function detectCustomErrorClasses(content: string, file: string): ExceptionPatternInfo[];
|
|
60
|
+
export declare function detectErrorInheritance(content: string, file: string): ExceptionPatternInfo[];
|
|
61
|
+
export declare function detectErrorFactories(content: string, file: string): ExceptionPatternInfo[];
|
|
62
|
+
export declare function detectRawErrorViolations(patterns: ExceptionPatternInfo[], content: string, file: string): ExceptionViolationInfo[];
|
|
63
|
+
export declare function analyzeExceptionHierarchy(content: string, file: string): ExceptionAnalysis;
|
|
64
|
+
export declare class ExceptionHierarchyDetector extends RegexDetector {
|
|
65
|
+
readonly id = "errors/exception-hierarchy";
|
|
66
|
+
readonly name = "Exception Hierarchy Detector";
|
|
67
|
+
readonly description = "Detects exception hierarchy and custom error patterns";
|
|
68
|
+
readonly category = "errors";
|
|
69
|
+
readonly subcategory = "hierarchy";
|
|
70
|
+
readonly supportedLanguages: Language[];
|
|
71
|
+
detect(context: DetectionContext): Promise<DetectionResult>;
|
|
72
|
+
generateQuickFix(): null;
|
|
73
|
+
}
|
|
74
|
+
export declare function createExceptionHierarchyDetector(): ExceptionHierarchyDetector;
|
|
75
|
+
//# sourceMappingURL=exception-hierarchy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exception-hierarchy.d.ts","sourceRoot":"","sources":["../../src/errors/exception-hierarchy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;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,oBAAoB,GAC5B,iBAAiB,GACjB,oBAAoB,GACpB,mBAAmB,GACnB,eAAe,CAAC;AAEp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