@critiq/rules 0.3.0 → 0.4.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/CHANGELOG.md +468 -0
- package/README.md +13 -233
- package/catalog-metadata.json +47 -0
- package/catalog.yaml +2962 -309
- package/package.json +1 -1
- package/rules/go/go.bug-risk.compound-assignment-misuse.rule.yaml +53 -0
- package/rules/go/go.bug-risk.deprecated-redis-methods.rule.yaml +57 -0
- package/rules/go/go.bug-risk.etcd-getlogger-misuse.rule.yaml +59 -0
- package/rules/go/go.bug-risk.etcd-invalid-compare-operator.rule.yaml +53 -0
- package/rules/go/go.bug-risk.gin-loadhtmlglob-ill-formed.rule.yaml +53 -0
- package/rules/go/go.bug-risk.gorm-dry-run-enabled.rule.yaml +58 -0
- package/rules/go/go.bug-risk.gorm-skip-default-transaction.rule.yaml +57 -0
- package/rules/go/go.bug-risk.gorm-updates-zero-values.rule.yaml +55 -0
- package/rules/go/go.bug-risk.gorm-where-zero-values.rule.yaml +53 -0
- package/rules/go/go.bug-risk.poorly-formed-nilness-guards.rule.yaml +57 -0
- package/rules/go/go.bug-risk.redis-incorrect-arg-count.rule.yaml +54 -0
- package/rules/go/go.bug-risk.redis-unimplemented-method.rule.yaml +53 -0
- package/rules/go/go.bug-risk.reflect-makefunc-usage.rule.yaml +55 -0
- package/rules/go/go.correctness.bare-return.rule.yaml +52 -0
- package/rules/go/go.correctness.boolean-literal-in-expression.rule.yaml +52 -0
- package/rules/go/go.correctness.boolean-simplification.rule.yaml +49 -0
- package/rules/go/go.correctness.deferred-func-literal.rule.yaml +52 -0
- package/rules/go/go.correctness.duplicate-branch-body.rule.yaml +49 -0
- package/rules/go/go.correctness.duplicate-function-arguments.rule.yaml +49 -0
- package/rules/go/go.correctness.duplicate-if-else-condition.rule.yaml +54 -0
- package/rules/go/go.correctness.duplicate-switch-cases.rule.yaml +48 -0
- package/rules/go/go.correctness.flag-pointer-immediate-deref.rule.yaml +49 -0
- package/rules/go/go.correctness.hidden-goroutine.rule.yaml +55 -0
- package/rules/go/go.correctness.http-nobody-nil.rule.yaml +52 -0
- package/rules/go/go.correctness.identical-binary-operands.rule.yaml +48 -0
- package/rules/go/go.correctness.impossible-interface-nil-check.rule.yaml +56 -0
- package/rules/go/go.correctness.incomplete-nil-check.rule.yaml +49 -0
- package/rules/go/go.correctness.integer-truncation.rule.yaml +51 -0
- package/rules/go/go.correctness.interface-any-preferred.rule.yaml +50 -0
- package/rules/go/go.correctness.nil-error-returned.rule.yaml +49 -0
- package/rules/go/go.correctness.off-by-one-index.rule.yaml +48 -0
- package/rules/go/go.correctness.redundant-type-declaration.rule.yaml +51 -0
- package/rules/go/go.correctness.signedness-casting.rule.yaml +56 -0
- package/rules/go/go.correctness.string-concat-simplify.rule.yaml +52 -0
- package/rules/go/go.correctness.suspicious-regex-pattern.rule.yaml +49 -0
- package/rules/go/go.correctness.terminal-call-with-defer.rule.yaml +50 -0
- package/rules/go/go.correctness.unexported-capital-name.rule.yaml +52 -0
- package/rules/go/go.correctness.unnecessary-dereference.rule.yaml +53 -0
- package/rules/go/go.correctness.unnecessary-else-return.rule.yaml +52 -0
- package/rules/go/go.correctness.unreachable-switch-case.rule.yaml +50 -0
- package/rules/go/go.doc.malformed-deprecated-comment.rule.yaml +59 -0
- package/rules/go/go.performance.avoid-large-loop-copy.rule.yaml +38 -0
- package/rules/go/go.performance.avoid-large-param-copy.rule.yaml +38 -0
- package/rules/go/go.performance.avoid-large-range-copy.rule.yaml +37 -0
- package/rules/go/go.performance.avoid-string-index-alloc.rule.yaml +38 -0
- package/rules/go/go.performance.combine-append-calls.rule.yaml +38 -0
- package/rules/go/go.performance.fmt-fprint.rule.yaml +44 -0
- package/rules/go/go.performance.iowriter-write-string.rule.yaml +45 -0
- package/rules/go/go.performance.non-idiomatic-slice-zeroing.rule.yaml +44 -0
- package/rules/go/go.performance.reorder-operands.rule.yaml +44 -0
- package/rules/go/go.performance.utf8-decode-rune.rule.yaml +44 -0
- package/rules/go/go.security.decompression-bomb.rule.yaml +55 -0
- package/rules/go/go.security.http-dir-path-traversal.rule.yaml +55 -0
- package/rules/go/go.security.incomplete-hostname-regex.rule.yaml +64 -0
- package/rules/go/go.security.insecure-ssl-protocol.rule.yaml +2 -0
- package/rules/go/go.security.jwt-without-verification.rule.yaml +2 -0
- package/rules/go/go.security.net-http-missing-timeouts.rule.yaml +3 -0
- package/rules/go/go.security.pprof-exposed.rule.yaml +2 -0
- package/rules/go/go.security.squirrel-unsafe-quoting.rule.yaml +64 -0
- package/rules/go/go.security.tainted-value-sink.rule.yaml +59 -0
- package/rules/go/go.security.tls-missing-min-version.rule.yaml +2 -0
- package/rules/go/go.security.unsafe-defer-close.rule.yaml +55 -0
- package/rules/go/go.security.weak-crypto-import.rule.yaml +3 -0
- package/rules/go/go.security.weak-file-permission.rule.yaml +56 -0
- package/rules/java/java.correctness.annotation-check-always-false.rule.yaml +42 -0
- package/rules/java/java.correctness.array-compared-to-non-array.rule.yaml +45 -0
- package/rules/java/java.correctness.array-index-bounds.rule.yaml +42 -0
- package/rules/java/java.correctness.assert-self-comparison.rule.yaml +46 -0
- package/rules/java/java.correctness.assertion-in-production.rule.yaml +49 -0
- package/rules/java/java.correctness.bad-short-circuit-null-check.rule.yaml +45 -0
- package/rules/java/java.correctness.bitwise-or-never-equal.rule.yaml +42 -0
- package/rules/java/java.correctness.boxed-boolean-conditional.rule.yaml +42 -0
- package/rules/java/java.correctness.cacheloader-null-return.rule.yaml +42 -0
- package/rules/java/java.correctness.case-insensitive-regex-lacks-unicode.rule.yaml +46 -0
- package/rules/java/java.correctness.catch-null-pointer.rule.yaml +5 -1
- package/rules/java/java.correctness.class-isinstance-on-class.rule.yaml +42 -0
- package/rules/java/java.correctness.class-name-collision.rule.yaml +45 -0
- package/rules/java/java.correctness.clone-without-super.rule.yaml +45 -0
- package/rules/java/java.correctness.closeable-provides-injection.rule.yaml +43 -0
- package/rules/java/java.correctness.collection-adds-self.rule.yaml +42 -0
- package/rules/java/java.correctness.collection-contains-self.rule.yaml +42 -0
- package/rules/java/java.correctness.collection-remove-type-mismatch.rule.yaml +42 -0
- package/rules/java/java.correctness.comparator-downcast-sign-flip.rule.yaml +42 -0
- package/rules/java/java.correctness.compareto-min-value.rule.yaml +44 -0
- package/rules/java/java.correctness.constructor-starts-thread.rule.yaml +45 -0
- package/rules/java/java.correctness.default-package-spring-scan.rule.yaml +46 -0
- package/rules/java/java.correctness.deprecated-thread-methods.rule.yaml +42 -0
- package/rules/java/java.correctness.double-assignment.rule.yaml +42 -0
- package/rules/java/java.correctness.double-checked-locking.rule.yaml +42 -0
- package/rules/java/java.correctness.duplicate-binary-argument.rule.yaml +45 -0
- package/rules/java/java.correctness.duration-with-nanos-misuse.rule.yaml +42 -0
- package/rules/java/java.correctness.enum-equals-method.rule.yaml +45 -0
- package/rules/java/java.correctness.enum-get-class.rule.yaml +42 -0
- package/rules/java/java.correctness.equals-inherits-parent.rule.yaml +45 -0
- package/rules/java/java.correctness.equals-null-check.rule.yaml +45 -0
- package/rules/java/java.correctness.equals-null.rule.yaml +45 -0
- package/rules/java/java.correctness.equals-on-array.rule.yaml +4 -0
- package/rules/java/java.correctness.explicit-finalizer-invocation.rule.yaml +45 -0
- package/rules/java/java.correctness.for-loop-mismatched-increment.rule.yaml +45 -0
- package/rules/java/java.correctness.getter-setter-sync-mismatch.rule.yaml +42 -0
- package/rules/java/java.correctness.hashcode-on-array.rule.yaml +42 -0
- package/rules/java/java.correctness.hashtable-contains-value.rule.yaml +42 -0
- package/rules/java/java.correctness.hasnext-invokes-next.rule.yaml +45 -0
- package/rules/java/java.correctness.ignored-inputstream-read.rule.yaml +45 -0
- package/rules/java/java.correctness.ignored-inputstream-skip.rule.yaml +45 -0
- package/rules/java/java.correctness.illegal-monitor-state-caught.rule.yaml +45 -0
- package/rules/java/java.correctness.impossible-toarray-downcast.rule.yaml +45 -0
- package/rules/java/java.correctness.incorrect-main-signature.rule.yaml +42 -0
- package/rules/java/java.correctness.indexof-reversed-arguments.rule.yaml +42 -0
- package/rules/java/java.correctness.instant-unsupported-temporal-unit.rule.yaml +42 -0
- package/rules/java/java.correctness.invalid-regex-literal.rule.yaml +45 -0
- package/rules/java/java.correctness.invalid-serial-version-uid.rule.yaml +42 -0
- package/rules/java/java.correctness.invalid-time-constants.rule.yaml +42 -0
- package/rules/java/java.correctness.invalidated-iterator.rule.yaml +42 -0
- package/rules/java/java.correctness.iterable-iterator-returns-this.rule.yaml +44 -0
- package/rules/java/java.correctness.iterable-path-type.rule.yaml +42 -0
- package/rules/java/java.correctness.jump-in-finally.rule.yaml +44 -0
- package/rules/java/java.correctness.loop-condition-never-true.rule.yaml +42 -0
- package/rules/java/java.correctness.lost-increment-in-assignment.rule.yaml +45 -0
- package/rules/java/java.correctness.math-max-min-swapped.rule.yaml +45 -0
- package/rules/java/java.correctness.missing-enum-switch-elements.rule.yaml +43 -0
- package/rules/java/java.correctness.modulus-multiplication-precedence.rule.yaml +42 -0
- package/rules/java/java.correctness.mutable-data-exposed.rule.yaml +42 -0
- package/rules/java/java.correctness.mutable-enum-fields.rule.yaml +44 -0
- package/rules/java/java.correctness.nan-comparison.rule.yaml +42 -0
- package/rules/java/java.correctness.ncopies-argument-order.rule.yaml +42 -0
- package/rules/java/java.correctness.noallocation-method-creates-object.rule.yaml +45 -0
- package/rules/java/java.correctness.non-final-immutable-fields.rule.yaml +45 -0
- package/rules/java/java.correctness.non-null-method-returns-null.rule.yaml +43 -0
- package/rules/java/java.correctness.non-terminating-loop.rule.yaml +42 -0
- package/rules/java/java.correctness.oddness-check-fails-negative.rule.yaml +45 -0
- package/rules/java/java.correctness.optional-get-without-present-check.rule.yaml +44 -0
- package/rules/java/java.correctness.optional-null.rule.yaml +42 -0
- package/rules/java/java.correctness.overloaded-equals.rule.yaml +45 -0
- package/rules/java/java.correctness.parameter-reassignment.rule.yaml +46 -0
- package/rules/java/java.correctness.possible-null-access-exception.rule.yaml +42 -0
- package/rules/java/java.correctness.possible-null-access.rule.yaml +42 -0
- package/rules/java/java.correctness.prepared-statement-in-loop.rule.yaml +52 -0
- package/rules/java/java.correctness.prepared-statement-index-zero.rule.yaml +44 -0
- package/rules/java/java.correctness.random-coerced-to-zero.rule.yaml +44 -0
- package/rules/java/java.correctness.read-resolve-return-type.rule.yaml +42 -0
- package/rules/java/java.correctness.readline-without-null-check.rule.yaml +45 -0
- package/rules/java/java.correctness.result-set-index-zero.rule.yaml +44 -0
- package/rules/java/java.correctness.runfinalizers-on-exit.rule.yaml +45 -0
- package/rules/java/java.correctness.runnable-run-direct.rule.yaml +45 -0
- package/rules/java/java.correctness.self-assignment.rule.yaml +45 -0
- package/rules/java/java.correctness.serializable-superclass.rule.yaml +42 -0
- package/rules/java/java.correctness.serialization-method-signature.rule.yaml +42 -0
- package/rules/java/java.correctness.servlet-mutable-fields.rule.yaml +45 -0
- package/rules/java/java.correctness.shift-out-of-range.rule.yaml +44 -0
- package/rules/java/java.correctness.static-date-field.rule.yaml +42 -0
- package/rules/java/java.correctness.stream-reuse.rule.yaml +42 -0
- package/rules/java/java.correctness.string-format-arg-mismatch.rule.yaml +45 -0
- package/rules/java/java.correctness.stringbuilder-char-ctor.rule.yaml +42 -0
- package/rules/java/java.correctness.switch-statement-labels.rule.yaml +44 -0
- package/rules/java/java.correctness.sync-boxed-primitive.rule.yaml +45 -0
- package/rules/java/java.correctness.sync-on-get-class.rule.yaml +42 -0
- package/rules/java/java.correctness.sync-on-lock-primitive.rule.yaml +45 -0
- package/rules/java/java.correctness.sync-on-mutable-ref.rule.yaml +42 -0
- package/rules/java/java.correctness.sync-on-nullable-field.rule.yaml +42 -0
- package/rules/java/java.correctness.sync-on-public-field.rule.yaml +42 -0
- package/rules/java/java.correctness.sync-on-string-literal.rule.yaml +2 -0
- package/rules/java/java.correctness.system-exit.rule.yaml +43 -0
- package/rules/java/java.correctness.thread-sleep-with-lock.rule.yaml +45 -0
- package/rules/java/java.correctness.thread-static-misuse.rule.yaml +42 -0
- package/rules/java/java.correctness.threadgroup-deprecated-methods.rule.yaml +43 -0
- package/rules/java/java.correctness.throw-null.rule.yaml +42 -0
- package/rules/java/java.correctness.timezone-invalid-id.rule.yaml +42 -0
- package/rules/java/java.correctness.two-lock-wait.rule.yaml +45 -0
- package/rules/java/java.correctness.unconditional-recursion.rule.yaml +42 -0
- package/rules/java/java.correctness.unescaped-whitespace.rule.yaml +42 -0
- package/rules/java/java.correctness.unimplementable-interface.rule.yaml +42 -0
- package/rules/java/java.correctness.unsafe-collection-downcast.rule.yaml +42 -0
- package/rules/java/java.correctness.unsafe-getresource.rule.yaml +45 -0
- package/rules/java/java.correctness.unsupported-jdk-api.rule.yaml +46 -0
- package/rules/java/java.correctness.unsupported-method-call.rule.yaml +42 -0
- package/rules/java/java.correctness.unsync-static-lazy-init.rule.yaml +42 -0
- package/rules/java/java.correctness.unsynchronized-wait-notify.rule.yaml +45 -0
- package/rules/java/java.correctness.unterminated-assertion-chain.rule.yaml +39 -0
- package/rules/java/java.correctness.volatile-array-elements.rule.yaml +45 -0
- package/rules/java/java.correctness.volatile-increment-non-atomic.rule.yaml +45 -0
- package/rules/java/java.correctness.wait-notify-on-thread.rule.yaml +45 -0
- package/rules/java/java.correctness.wait-on-condition.rule.yaml +45 -0
- package/rules/java/java.correctness.week-year-in-date-pattern.rule.yaml +44 -0
- package/rules/java/java.correctness.zoneid-invalid-timezone.rule.yaml +42 -0
- package/rules/java/java.doc.empty-javadoc-tag.rule.yaml +41 -0
- package/rules/java/java.doc.malformed-javadoc-comment.rule.yaml +41 -0
- package/rules/java/java.doc.parameter-tag-no-description.rule.yaml +41 -0
- package/rules/java/java.doc.unmatched-parameter-tag.rule.yaml +41 -0
- package/rules/java/java.performance.boxed-boolean-constructor.rule.yaml +43 -0
- package/rules/java/java.performance.boxed-double-constructor.rule.yaml +43 -0
- package/rules/java/java.performance.boxed-integer-constructor.rule.yaml +43 -0
- package/rules/java/java.performance.empty-string-constructor.rule.yaml +44 -0
- package/rules/java/java.performance.expensive-method-on-ui-thread.rule.yaml +50 -0
- package/rules/java/java.performance.explicit-gc.rule.yaml +43 -0
- package/rules/java/java.performance.inefficient-string-constructor.rule.yaml +44 -0
- package/rules/java/java.performance.keyset-instead-of-entryset.rule.yaml +49 -0
- package/rules/java/java.performance.non-zero-to-array.rule.yaml +49 -0
- package/rules/java/java.performance.pattern-compile-in-loop.rule.yaml +49 -0
- package/rules/java/java.performance.removeall-to-clear.rule.yaml +49 -0
- package/rules/java/java.performance.replaceall-instead-of-replace.rule.yaml +49 -0
- package/rules/java/java.performance.single-char-string-indexof.rule.yaml +49 -0
- package/rules/java/java.performance.string-concat-in-loop.rule.yaml +49 -0
- package/rules/java/java.performance.string-to-string.rule.yaml +43 -0
- package/rules/java/java.performance.thread-as-runnable.rule.yaml +44 -0
- package/rules/java/java.performance.url-in-collection.rule.yaml +44 -0
- package/rules/java/java.quality.c-style-array-declaration.rule.yaml +41 -0
- package/rules/java/java.quality.multiple-variables-same-line.rule.yaml +41 -0
- package/rules/java/java.quality.type-name-uppercase.rule.yaml +41 -0
- package/rules/java/java.testing.setup-teardown-annotation.rule.yaml +36 -0
- package/rules/java/java.testing.setup-without-super.rule.yaml +43 -0
- package/rules/java/java.testing.teardown-without-super.rule.yaml +43 -0
- package/rules/java/java.testing.wrong-assertion-argument-order.rule.yaml +43 -0
- package/rules/php/php.correctness.abstract-method-outside-abstract-class.rule.yaml +3 -0
- package/rules/php/php.correctness.abstract-method-with-body.rule.yaml +38 -0
- package/rules/php/php.correctness.assign-to-non-lvalue.rule.yaml +38 -0
- package/rules/php/php.correctness.attribute-on-class-constant.rule.yaml +38 -0
- package/rules/php/php.correctness.attribute-on-closure.rule.yaml +38 -0
- package/rules/php/php.correctness.attribute-on-function.rule.yaml +38 -0
- package/rules/php/php.correctness.attribute-on-property.rule.yaml +40 -0
- package/rules/php/php.correctness.break-continue-outside-loop.rule.yaml +2 -0
- package/rules/php/php.correctness.case-insensitive-define.rule.yaml +2 -0
- package/rules/php/php.correctness.class-implements-non-interface.rule.yaml +38 -0
- package/rules/php/php.correctness.default-parameter-not-last.rule.yaml +2 -0
- package/rules/php/php.correctness.deprecated-filter-constant.rule.yaml +2 -0
- package/rules/php/php.correctness.deprecated-libxml-entity-loader.rule.yaml +2 -0
- package/rules/php/php.correctness.deprecated-unset-cast.rule.yaml +2 -0
- package/rules/php/php.correctness.duplicate-array-key.rule.yaml +2 -0
- package/rules/php/php.correctness.duplicate-declaration.rule.yaml +2 -0
- package/rules/php/php.correctness.duplicate-union-type.rule.yaml +38 -0
- package/rules/php/php.correctness.echo-invalid-value.rule.yaml +38 -0
- package/rules/php/php.correctness.empty-array-literal-slot.rule.yaml +2 -0
- package/rules/php/php.correctness.empty-bracket-array-access.rule.yaml +2 -0
- package/rules/php/php.correctness.empty-code-block.rule.yaml +2 -0
- package/rules/php/php.correctness.empty-function-body.rule.yaml +2 -0
- package/rules/php/php.correctness.error-suppression-operator.rule.yaml +2 -0
- package/rules/php/php.correctness.function-comparison.rule.yaml +2 -0
- package/rules/php/php.correctness.inaccessible-property.rule.yaml +49 -0
- package/rules/php/php.correctness.incomplete-arrow-function.rule.yaml +38 -0
- package/rules/php/php.correctness.inconsistent-printf-params.rule.yaml +50 -0
- package/rules/php/php.correctness.instanceof-invalid-type.rule.yaml +40 -0
- package/rules/php/php.correctness.instantiate-abstract-class.rule.yaml +38 -0
- package/rules/php/php.correctness.interface-extends-non-interface.rule.yaml +38 -0
- package/rules/php/php.correctness.interface-implements-keyword.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-arrow-function-typehint.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-attribute-class.rule.yaml +49 -0
- package/rules/php/php.correctness.invalid-closure-return-typehint.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-constructor-promotion.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-cookie-options.rule.yaml +2 -0
- package/rules/php/php.correctness.invalid-dynamic-constant-fetch.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-extends-target.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-increment-operand.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-isset-argument.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-return-typehint.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-static-method.rule.yaml +40 -0
- package/rules/php/php.correctness.invalid-string-interpolation-type.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-type-cast.rule.yaml +38 -0
- package/rules/php/php.correctness.invalid-use-keyword.rule.yaml +48 -0
- package/rules/php/php.correctness.missing-member-visibility.rule.yaml +2 -0
- package/rules/php/php.correctness.missing-return-statement.rule.yaml +38 -0
- package/rules/php/php.correctness.named-arg-before-positional.rule.yaml +38 -0
- package/rules/php/php.correctness.nested-function-declaration.rule.yaml +2 -0
- package/rules/php/php.correctness.nested-switch.rule.yaml +2 -0
- package/rules/php/php.correctness.nullable-mixed-type.rule.yaml +38 -0
- package/rules/php/php.correctness.nullsafe-returned-by-reference.rule.yaml +3 -0
- package/rules/php/php.correctness.print-invalid-value.rule.yaml +38 -0
- package/rules/php/php.correctness.psr-class-constant-naming.rule.yaml +38 -0
- package/rules/php/php.correctness.psr-method-camel-case.rule.yaml +38 -0
- package/rules/php/php.correctness.redundant-final-method.rule.yaml +38 -0
- package/rules/php/php.correctness.redundant-string-cast-concat.rule.yaml +2 -0
- package/rules/php/php.correctness.self-assignment.rule.yaml +2 -0
- package/rules/php/php.correctness.switch-multiple-default.rule.yaml +2 -0
- package/rules/php/php.correctness.throw-as-expression.rule.yaml +38 -0
- package/rules/php/php.correctness.throw-non-exception.rule.yaml +38 -0
- package/rules/php/php.correctness.trait-as-attribute.rule.yaml +38 -0
- package/rules/php/php.correctness.trait-class-constant.rule.yaml +38 -0
- package/rules/php/php.correctness.undefined-constant-reference.rule.yaml +38 -0
- package/rules/php/php.correctness.undefined-function.rule.yaml +40 -0
- package/rules/php/php.correctness.undefined-method.rule.yaml +40 -0
- package/rules/php/php.correctness.undefined-property.rule.yaml +51 -0
- package/rules/php/php.correctness.undefined-static-property.rule.yaml +41 -0
- package/rules/php/php.correctness.undefined-variable.rule.yaml +48 -0
- package/rules/php/php.correctness.uninitialized-typed-property.rule.yaml +38 -0
- package/rules/php/php.correctness.unknown-magic-method.rule.yaml +2 -0
- package/rules/php/php.correctness.unreachable-after-return.rule.yaml +2 -0
- package/rules/php/php.correctness.unused-closure-use-variable.rule.yaml +38 -0
- package/rules/php/php.correctness.unused-constructor-parameter.rule.yaml +38 -0
- package/rules/php/php.correctness.unused-import.rule.yaml +38 -0
- package/rules/php/php.correctness.useless-post-increment.rule.yaml +2 -0
- package/rules/php/php.correctness.useless-unset.rule.yaml +2 -0
- package/rules/php/php.correctness.void-match-arm.rule.yaml +38 -0
- package/rules/php/php.performance.expensive-loop-condition.rule.yaml +2 -0
- package/rules/php/php.security.debug-function-exposure.rule.yaml +2 -0
- package/rules/php/php.security.insecure-session-id-generation.rule.yaml +2 -0
- package/rules/php/php.security.insecure-session-or-cookie-config.rule.yaml +3 -0
- package/rules/php/php.security.no-dynamic-eval.rule.yaml +2 -0
- package/rules/php/php.security.unsafe-include-with-user-input.rule.yaml +2 -0
- package/rules/php/php.security.unsafe-new-static.rule.yaml +2 -0
- package/rules/php/php.security.weak-cipher.rule.yaml +2 -0
- package/rules/php/php.security.xml-external-entity.rule.yaml +2 -0
- package/rules/python/py.correctness.assert-outside-test.rule.yaml +49 -0
- package/rules/python/py.correctness.global-statement.rule.yaml +51 -0
- package/rules/python/py.correctness.redefined-builtin.rule.yaml +51 -0
- package/rules/python/py.correctness.super-with-arguments.rule.yaml +51 -0
- package/rules/python/py.correctness.unnecessary-comprehension.rule.yaml +51 -0
- package/rules/python/py.correctness.useless-return.rule.yaml +51 -0
- package/rules/python/py.security.command-execution-with-request-input.rule.yaml +56 -0
- package/rules/python/py.security.ftp-usage.rule.yaml +51 -0
- package/rules/python/py.security.hardcoded-credentials.rule.yaml +51 -0
- package/rules/python/py.security.hardcoded-temp-directory.rule.yaml +51 -0
- package/rules/python/py.security.insecure-cipher-mode.rule.yaml +51 -0
- package/rules/python/py.security.insecure-cipher.rule.yaml +51 -0
- package/rules/python/py.security.insecure-crypto-import.rule.yaml +51 -0
- package/rules/python/py.security.insecure-http-transport.rule.yaml +56 -0
- package/rules/python/py.security.insecure-ssl-version.rule.yaml +53 -0
- package/rules/python/py.security.insecure-urllib-method.rule.yaml +51 -0
- package/rules/python/py.security.insecure-xml-parser.rule.yaml +53 -0
- package/rules/python/py.security.mako-insecure-templates.rule.yaml +53 -0
- package/rules/python/py.security.path-traversal-user-input.rule.yaml +51 -0
- package/rules/python/py.security.request-path-file-read.rule.yaml +56 -0
- package/rules/python/py.security.sensitive-logging.rule.yaml +51 -0
- package/rules/python/py.security.sql-interpolation.rule.yaml +56 -0
- package/rules/python/py.security.ssh-host-key-validation.rule.yaml +53 -0
- package/rules/python/py.security.telnet-usage.rule.yaml +51 -0
- package/rules/python/py.security.tls-verification-disabled.rule.yaml +56 -0
- package/rules/python/py.security.unsafe-deserialization.rule.yaml +56 -0
- package/rules/python/py.security.weak-crypto-key.rule.yaml +51 -0
- package/rules/python/py.security.weak-hash-algorithm.rule.yaml +57 -0
- package/rules/python/py.security.wildcard-subprocess-injection.rule.yaml +53 -0
- package/rules/python/py.security.xmlrpc-import.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.action-mailer-base-subclass.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.active-job-base-subclass.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.active-record-alias.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.active-record-base-subclass.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.active-record-method-override.rule.yaml +55 -0
- package/rules/ruby/ruby.bug-risk.active-support-alias.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.all-each-to-find-each.rule.yaml +55 -0
- package/rules/ruby/ruby.bug-risk.allow-blank-with-delegate.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.alter-queries-combine.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.ambiguous-block-association.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.ambiguous-operator-argument.rule.yaml +48 -0
- package/rules/ruby/ruby.bug-risk.ambiguous-regexp-literal.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.argument-overwritten-before-use.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.assert-not-usage.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.bad-date-usage.rule.yaml +55 -0
- package/rules/ruby/ruby.bug-risk.bad-magic-comment-order.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.bad-operand-order.rule.yaml +46 -0
- package/rules/ruby/ruby.bug-risk.bad-rescue-ordering.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.branches-without-body.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.callback-order.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.callback-override.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.circular-argument-reference.rule.yaml +44 -0
- package/rules/ruby/ruby.bug-risk.class-name-should-be-string.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.console-output-instead-of-logger.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.constant-in-block.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.controller-base-subclass.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.dependent-option-cascade.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.deprecated-belongs-to-required.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.deprecated-big-decimal-new.rule.yaml +44 -0
- package/rules/ruby/ruby.bug-risk.deprecated-class-methods.rule.yaml +45 -0
- package/rules/ruby/ruby.bug-risk.deprecated-filter-methods.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.deprecated-find-by-dynamic.rule.yaml +55 -0
- package/rules/ruby/ruby.bug-risk.deprecated-http-status-symbols.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.deprecated-openssl-api.rule.yaml +42 -0
- package/rules/ruby/ruby.bug-risk.deprecated-uri-regexp.rule.yaml +42 -0
- package/rules/ruby/ruby.bug-risk.disjunctive-assignment-in-constructor.rule.yaml +46 -0
- package/rules/ruby/ruby.bug-risk.duplicate-case-conditions.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.duplicate-constant-assignment.rule.yaml +47 -0
- package/rules/ruby/ruby.bug-risk.duplicate-elsif-block.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.duplicate-method-definitions.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.each-with-object-immutable-arg.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.else-followed-by-expression.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.else-without-rescue.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.empty-ensure-block.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.empty-expression.rule.yaml +48 -0
- package/rules/ruby/ruby.bug-risk.empty-interpolation.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.end-in-method.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.enum-array-syntax.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.enum-duplicate-values.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.equal-instead-of-equal.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.error-inherits-exception.rule.yaml +42 -0
- package/rules/ruby/ruby.bug-risk.exit-in-app-code.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.flip-flop-operator.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.git-in-gemspec.rule.yaml +48 -0
- package/rules/ruby/ruby.bug-risk.grouped-parentheses-in-call.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.has-and-belongs-to-many.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.helper-instance-variables.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.heredoc-method-order.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.http-methods-without-params.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.identical-binary-operands.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.ignored-column-accessed.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.inconsistent-request-referrer.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.inconsistent-safe-navigation-try.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.inconsistent-safe-navigation.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.incorrect-pluralization.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.ineffective-access-modifier.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.interpolation-in-single-quote.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.invalid-integer-times.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.invalid-percent-string-literal.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.invalid-percent-symbol-array.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.invalid-rails-env-predicate.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.invalid-rescue-type.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.io-select-single-arg.rule.yaml +48 -0
- package/rules/ruby/ruby.bug-risk.irreversible-migration.rule.yaml +57 -0
- package/rules/ruby/ruby.bug-risk.missing-inverse-of.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.mixed-regex-captures.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.multiple-rescues-for-same-exception.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.non-local-exit-from-iterator.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.non-null-column-without-default.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.non-preferred-assert-falseness.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.old-style-validation-macro.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.outer-variable-shadowed.rule.yaml +47 -0
- package/rules/ruby/ruby.bug-risk.plain-method-instead-of-proc.rule.yaml +48 -0
- package/rules/ruby/ruby.bug-risk.predicate-method-without-parentheses.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.rails-env-equality.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.rails-root-join.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.rake-task-missing-environment.rule.yaml +46 -0
- package/rules/ruby/ruby.bug-risk.redundant-allow-nil.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.redundant-foreign-key.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.redundant-with-options-receiver.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.regex-literal-in-condition.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.relative-date-as-constant.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.renamed-column-accessed.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.rescue-exception.rule.yaml +42 -0
- package/rules/ruby/ruby.bug-risk.return-in-ensure.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.routes-match-single-verb.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.safe-navigation-with-blank.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.safe-navigation-with-empty.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.self-assignment.rule.yaml +52 -0
- package/rules/ruby/ruby.bug-risk.skip-filter-conditional.rule.yaml +55 -0
- package/rules/ruby/ruby.bug-risk.suppressed-exceptions.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.symbol-boolean-name.rule.yaml +44 -0
- package/rules/ruby/ruby.bug-risk.table-without-timestamps.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.time-without-zone.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.to-json-without-argument.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.trailing-comma-attribute.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.undefined-action-filter.rule.yaml +53 -0
- package/rules/ruby/ruby.bug-risk.unintended-string-concatenation.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.unnecessary-require.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.unnecessary-splat.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.unqualified-constant.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.unreachable-code.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.unreachable-loop.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.unsafe-number-conversion.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.unsafe-safe-navigation-chain.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.unused-method-arguments.rule.yaml +51 -0
- package/rules/ruby/ruby.bug-risk.use-blank-simplify.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.use-delegate.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.use-presence-over-explicit-check.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.use-present-to-simplify-conditional.rule.yaml +48 -0
- package/rules/ruby/ruby.bug-risk.use-square-brackets-for-attributes.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.useless-access-modifier.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.useless-comparison.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.useless-setter-call.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.when-branch-without-body.rule.yaml +49 -0
- package/rules/ruby/ruby.bug-risk.where-first-over-find-by.rule.yaml +54 -0
- package/rules/ruby/ruby.bug-risk.with-index-value-unused.rule.yaml +50 -0
- package/rules/ruby/ruby.bug-risk.with-object-value-unused.rule.yaml +50 -0
- package/rules/ruby/ruby.performance.efficient-hash-search.rule.yaml +42 -0
- package/rules/ruby/ruby.performance.enumerable-index-by.rule.yaml +51 -0
- package/rules/ruby/ruby.performance.enumerable-index-with.rule.yaml +52 -0
- package/rules/ruby/ruby.performance.merge-single-key.rule.yaml +42 -0
- package/rules/ruby/ruby.performance.no-static-size-computation.rule.yaml +43 -0
- package/rules/ruby/ruby.performance.prefer-delete-prefix.rule.yaml +53 -0
- package/rules/ruby/ruby.performance.prefer-delete-suffix.rule.yaml +53 -0
- package/rules/ruby/ruby.performance.prefer-flat-map.rule.yaml +41 -0
- package/rules/ruby/ruby.performance.prefer-struct-over-openstruct.rule.yaml +42 -0
- package/rules/ruby/ruby.performance.range-cover-over-include.rule.yaml +43 -0
- package/rules/ruby/ruby.performance.regex-match-over-match.rule.yaml +42 -0
- package/rules/ruby/ruby.performance.yield-over-block-call.rule.yaml +41 -0
- package/rules/ruby/ruby.security.io-shell-command.rule.yaml +50 -0
- package/rules/ruby/ruby.security.rails-http-digest-auth.rule.yaml +51 -0
- package/rules/ruby/ruby.security.rails-render-inline.rule.yaml +55 -0
- package/rules/ruby/ruby.security.rails-skip-validation.rule.yaml +51 -0
- package/rules/rust/rust.correctness.empty-range-expression.rule.yaml +49 -0
- package/rules/rust/rust.correctness.erasing-operation.rule.yaml +49 -0
- package/rules/rust/rust.correctness.forget-drop-on-copy-type.rule.yaml +50 -0
- package/rules/rust/rust.correctness.forget-drop-on-non-drop-type.rule.yaml +50 -0
- package/rules/rust/rust.correctness.forget-drop-on-reference.rule.yaml +49 -0
- package/rules/rust/rust.correctness.hash-unit-value.rule.yaml +49 -0
- package/rules/rust/rust.correctness.identical-binary-operands.rule.yaml +49 -0
- package/rules/rust/rust.correctness.ignored-future-value.rule.yaml +53 -0
- package/rules/rust/rust.correctness.invalid-regex-literal.rule.yaml +49 -0
- package/rules/rust/rust.correctness.iter-next-in-for-loop.rule.yaml +49 -0
- package/rules/rust/rust.correctness.mistyped-suffix.rule.yaml +50 -0
- package/rules/rust/rust.correctness.nan-comparison.rule.yaml +49 -0
- package/rules/rust/rust.correctness.non-binding-let-on-lock.rule.yaml +50 -0
- package/rules/rust/rust.correctness.non-octal-permissions.rule.yaml +60 -0
- package/rules/rust/rust.correctness.print-in-display-impl.rule.yaml +48 -0
- package/rules/rust/rust.correctness.self-not-self-type.rule.yaml +49 -0
- package/rules/rust/rust.correctness.step-by-zero.rule.yaml +48 -0
- package/rules/rust/rust.correctness.syntax-error.rule.yaml +49 -0
- package/rules/rust/rust.correctness.transmute-float-char-to-ref-or-ptr.rule.yaml +48 -0
- package/rules/rust/rust.correctness.transmute-int-lit-to-raw-ptr.rule.yaml +48 -0
- package/rules/rust/rust.correctness.transmute-int-to-fn-ptr.rule.yaml +48 -0
- package/rules/rust/rust.correctness.transmute-integer-to-bool.rule.yaml +49 -0
- package/rules/rust/rust.correctness.transmute-integer-to-char.rule.yaml +48 -0
- package/rules/rust/rust.correctness.transmute-integer-to-nonzero.rule.yaml +48 -0
- package/rules/rust/rust.correctness.transmute-number-to-slice-or-array.rule.yaml +48 -0
- package/rules/rust/rust.correctness.transmute-ptr-to-ptr.rule.yaml +49 -0
- package/rules/rust/rust.correctness.transmute-ptr-to-ref.rule.yaml +49 -0
- package/rules/rust/rust.correctness.transmute-ref-to-ptr.rule.yaml +49 -0
- package/rules/rust/rust.correctness.transmute-t-to-ptr-ref.rule.yaml +49 -0
- package/rules/rust/rust.correctness.transmute-tuple-to-slice-or-array.rule.yaml +48 -0
- package/rules/rust/rust.correctness.unhandled-io-result.rule.yaml +49 -0
- package/rules/rust/rust.correctness.unit-argument.rule.yaml +50 -0
- package/rules/rust/rust.correctness.unit-comparison.rule.yaml +49 -0
- package/rules/rust/rust.performance.single-char-string-literal-pattern.rule.yaml +51 -0
- package/rules/rust/rust.quality.approximate-floating-constant.rule.yaml +51 -0
- package/rules/rust/rust.quality.builtin-type-shadow.rule.yaml +49 -0
- package/rules/rust/rust.quality.clone-on-double-reference.rule.yaml +50 -0
- package/rules/rust/rust.quality.crate-in-macro-definition.rule.yaml +50 -0
- package/rules/rust/rust.quality.deprecated-function-use.rule.yaml +52 -0
- package/rules/rust/rust.quality.env-string-literal.rule.yaml +50 -0
- package/rules/rust/rust.quality.explicit-self-assignment.rule.yaml +49 -0
- package/rules/rust/rust.quality.fn-ptr-null-comparison.rule.yaml +49 -0
- package/rules/rust/rust.quality.fn-ptr-to-non-pointer-cast.rule.yaml +50 -0
- package/rules/rust/rust.quality.inaccurate-duration-calculation.rule.yaml +50 -0
- package/rules/rust/rust.quality.isize-usize-overflow.rule.yaml +50 -0
- package/rules/rust/rust.quality.iter-count-instead-of-len.rule.yaml +49 -0
- package/rules/rust/rust.quality.iter-nth-instead-of-get.rule.yaml +50 -0
- package/rules/rust/rust.quality.map-followed-by-count.rule.yaml +50 -0
- package/rules/rust/rust.quality.non-owned-rc-pointer-into-vec.rule.yaml +50 -0
- package/rules/rust/rust.quality.non-utf8-literal-in-from-utf8-unchecked.rule.yaml +54 -0
- package/rules/rust/rust.quality.option-env-unwrap.rule.yaml +50 -0
- package/rules/rust/rust.quality.ordered-iteration-on-unordered.rule.yaml +52 -0
- package/rules/rust/rust.quality.possible-missing-comma-in-array.rule.yaml +49 -0
- package/rules/rust/rust.quality.potentially-incomplete-ascii-range.rule.yaml +49 -0
- package/rules/rust/rust.quality.redundant-mem-replace-with-default.rule.yaml +48 -0
- package/rules/rust/rust.quality.redundant-mem-replace-with-none.rule.yaml +48 -0
- package/rules/rust/rust.quality.redundant-mem-replace-with-zero.rule.yaml +48 -0
- package/rules/rust/rust.quality.replace-same-pattern-and-replacement.rule.yaml +49 -0
- package/rules/rust/rust.quality.size-of-val-on-reference.rule.yaml +49 -0
- package/rules/rust/rust.quality.unused-enumerate-or-zip-items.rule.yaml +50 -0
- package/rules/rust/rust.security.actix-namedfile-path-traversal.rule.yaml +61 -0
- package/rules/rust/rust.security.bind-all-interfaces.rule.yaml +2 -0
- package/rules/rust/rust.security.const-to-mut-ptr.rule.yaml +61 -0
- package/rules/rust/rust.security.differently-sized-slice-conversion.rule.yaml +61 -0
- package/rules/rust/rust.security.global-write-permission.rule.yaml +61 -0
- package/rules/rust/rust.security.insecure-temp-file.rule.yaml +2 -0
- package/rules/rust/rust.security.invisible-unicode.rule.yaml +60 -0
- package/rules/rust/rust.security.manual-error-type-id.rule.yaml +59 -0
- package/rules/rust/rust.security.missing-regex-anchor.rule.yaml +61 -0
- package/rules/rust/rust.security.misused-bitwise-xor.rule.yaml +54 -0
- package/rules/rust/rust.security.open-redirect.rule.yaml +64 -0
- package/rules/rust/rust.security.potentially-vulnerable-regex.rule.yaml +61 -0
- package/rules/rust/rust.security.raw-slice-to-ptr.rule.yaml +60 -0
- package/rules/rust/rust.security.unsafe-remove-dir-all.rule.yaml +62 -0
- package/rules/rust/rust.security.weak-crypto-import.rule.yaml +2 -0
- package/rules/rust/rust.security.weak-rsa-key-size.rule.yaml +2 -0
- package/rules/rust/rust.testing.ignore-without-ticket-reference.rule.yaml +13 -7
- package/rules/rust/rust.testing.thread-sleep-in-unit-test.rule.yaml +6 -6
- package/rules/shared/security.no-command-execution-with-request-input.rule.yaml +3 -0
- package/rules/shared/security.no-sensitive-data-in-logs-and-telemetry.rule.yaml +2 -0
- package/rules/shared/security.no-sql-interpolation.rule.yaml +2 -0
- package/rules/shared/security.permissive-file-permissions.rule.yaml +2 -0
- package/rules/shared/security.weak-hash-algorithm.rule.yaml +2 -0
- package/rules/sql/sql.correctness.undefined-reference.rule.yaml +37 -0
- package/rules/sql/sql.style.ambiguous-distinct.rule.yaml +37 -0
- package/rules/sql/sql.style.column-expression-without-alias.rule.yaml +37 -0
- package/rules/sql/sql.style.distinct-with-parenthesis.rule.yaml +37 -0
- package/rules/sql/sql.style.duplicate-table-aliases.rule.yaml +37 -0
- package/rules/sql/sql.style.implicit-column-alias.rule.yaml +37 -0
- package/rules/sql/sql.style.implicit-table-alias.rule.yaml +37 -0
- package/rules/sql/sql.style.inconsistent-capitalization.rule.yaml +37 -0
- package/rules/sql/sql.style.inconsistent-keyword-case.rule.yaml +37 -0
- package/rules/sql/sql.style.keyword-as-identifier.rule.yaml +37 -0
- package/rules/sql/sql.style.trailing-select-comma.rule.yaml +37 -0
- package/rules/sql/sql.style.unqualified-references.rule.yaml +37 -0
- package/rules/sql/sql.style.unused-table-alias.rule.yaml +37 -0
- package/rules/typescript/ts.angularjs.inject-function-assignments-only.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.no-controller.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.no-deprecated-cookie-store.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.no-deprecated-directive-replace.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.no-deprecated-http-success-error.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.no-jquery-wrapping-angular-element.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.prefer-angular-for-each.rule.yaml +36 -0
- package/rules/typescript/ts.angularjs.prefer-angular-is-string.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.array-callback-missing-return.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.array-sort-without-compare.rule.yaml +5 -3
- package/rules/typescript/ts.correctness.assignment-in-condition.rule.yaml +4 -2
- package/rules/typescript/ts.correctness.assignment-to-exports.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.assignment-to-import-binding.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.async-promise-executor.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.blocking-call-in-async-flow.rule.yaml +14 -3
- package/rules/typescript/ts.correctness.callback-missing-error-handling.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.callback-not-error-first.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.compound-assignment-with-await.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.confusing-multiline-expression.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.constructor-return-value.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.control-flow-in-finally.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.declaration-in-nested-block.rule.yaml +39 -0
- package/rules/typescript/ts.correctness.delete-on-variable.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.deprecated-api-usage.rule.yaml +39 -0
- package/rules/typescript/ts.correctness.duplicate-class-member.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.duplicate-export.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.duplicate-function-parameter.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.duplicate-if-else-condition.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.duplicate-import-source.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.duplicate-object-key.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.duplicate-switch-case.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.empty-block-statement.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.empty-destructuring-pattern.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.extraneous-import.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.flawed-string-comparison.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.global-object-called-as-function.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.identical-comparison-operands.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.implicit-undefined-return.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.infinite-loop.rule.yaml +16 -7
- package/rules/typescript/ts.correctness.invalid-async-await-call.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.invalid-shebang.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.invalid-typeof-comparison.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.invalid-variable-usage.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.missing-async-on-promise-method.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.missing-super-call.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.missing-timeout-on-external-call.rule.yaml +13 -6
- package/rules/typescript/ts.correctness.missing-type-annotation.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.namespace-import-unexported-name.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.negative-zero-comparison.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.new-expression-with-require.rule.yaml +39 -0
- package/rules/typescript/ts.correctness.new-symbol-instance.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.no-confusing-label-in-switch.rule.yaml +39 -0
- package/rules/typescript/ts.correctness.no-href-with-nuxt-link.rule.yaml +39 -0
- package/rules/typescript/ts.correctness.no-ts-suppress-directive.rule.yaml +36 -0
- package/rules/typescript/ts.correctness.non-existent-assignment-operators.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.off-by-one-loop-boundary.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.parse-int-on-number-literal.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.prefer-as-const-over-literal-type.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.prefer-includes-over-indexof.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.prefer-nullish-coalescing.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.private-member-should-be-readonly.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.promise-reject-non-error.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.prototype-builtin-called-directly.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.reassign-catch-binding.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.reassign-class-member.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.reassign-const-binding.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.reassign-function-declaration.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.regexp-constructor-invalid-pattern.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.regexp-empty-character-class.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.regexp-multicodepoint-character-class.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.regexp-pattern-unusual-control-character.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.regexp-useless-backreference.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.require-outside-import.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.restricted-global-variable.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.restricted-object-property.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.self-assignment.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.setter-return-value.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.simplify-boolean-return.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.sparse-array-literal.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.switch-case-fallthrough.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.template-placeholder-in-string.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.this-before-super.rule.yaml +3 -0
- package/rules/typescript/ts.correctness.this-outside-class.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.undeclared-variable.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.unhandled-async-error.rule.yaml +7 -1
- package/rules/typescript/ts.correctness.unnecessary-return-await.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.unresolved-import.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.unsafe-negation-in-relational.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.unused-expression.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.unused-variable.rule.yaml +37 -0
- package/rules/typescript/ts.correctness.use-number-is-nan.rule.yaml +2 -0
- package/rules/typescript/ts.correctness.used-before-definition.rule.yaml +38 -0
- package/rules/typescript/ts.correctness.var-declaration.rule.yaml +38 -0
- package/rules/typescript/ts.next.no-document-import-outside-custom-document.rule.yaml +39 -0
- package/rules/typescript/ts.next.no-head-import-in-custom-document.rule.yaml +39 -0
- package/rules/typescript/ts.performance.no-await-in-loop.rule.yaml +6 -6
- package/rules/typescript/ts.performance.no-json-parse-stringify-clone.rule.yaml +8 -0
- package/rules/typescript/ts.performance.sequential-async-calls.rule.yaml +16 -7
- package/rules/typescript/ts.quality.no-banned-type.rule.yaml +36 -0
- package/rules/typescript/ts.quality.no-empty-function.rule.yaml +1 -1
- package/rules/typescript/ts.quality.no-side-effect-in-pure-callback.rule.yaml +36 -0
- package/rules/typescript/ts.quality.swallowed-error.rule.yaml +6 -3
- package/rules/typescript/ts.react.no-deprecated-is-mounted.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-deprecated-react-dom-root-api.rule.yaml +24 -2
- package/rules/typescript/ts.react.no-direct-state-mutation.rule.yaml +2 -0
- package/rules/typescript/ts.react.no-duplicate-jsx-attributes.rule.yaml +2 -0
- package/rules/typescript/ts.react.no-hooks-rule-violation.rule.yaml +38 -0
- package/rules/typescript/ts.react.no-invalid-markup-characters.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-lifecycle-method-typo.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-render-invalid-return-type.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-set-state-in-component-did-mount.rule.yaml +2 -0
- package/rules/typescript/ts.react.no-set-state-in-component-did-update.rule.yaml +2 -0
- package/rules/typescript/ts.react.no-set-state-in-component-will-update.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-should-component-update.rule.yaml +36 -0
- package/rules/typescript/ts.react.no-target-blank-without-rel.rule.yaml +2 -0
- package/rules/typescript/ts.react.no-this-state-in-set-state.rule.yaml +38 -0
- package/rules/typescript/ts.react.no-unnecessary-fragment.rule.yaml +36 -0
- package/rules/typescript/ts.runtime.no-process-exit.rule.yaml +3 -0
- package/rules/typescript/ts.runtime.process-exit-control-flow.rule.yaml +46 -0
- package/rules/typescript/ts.security.dangerous-insert-html.rule.yaml +5 -0
- package/rules/typescript/ts.security.express-insecure-listen.rule.yaml +52 -0
- package/rules/typescript/ts.security.express-nosql-injection.rule.yaml +16 -11
- package/rules/typescript/ts.security.express-static-dotfiles-allow.rule.yaml +5 -0
- package/rules/typescript/ts.security.iframe-missing-sandbox-attribute.rule.yaml +18 -6
- package/rules/typescript/ts.security.import-using-user-input.rule.yaml +62 -10
- package/rules/typescript/ts.security.insecure-auth-cookie-flags.rule.yaml +12 -4
- package/rules/typescript/ts.security.missing-request-timeout-or-retry.rule.yaml +8 -6
- package/rules/typescript/ts.security.no-assign-mutable-export.rule.yaml +2 -0
- package/rules/typescript/ts.security.no-dynamic-execution.rule.yaml +3 -3
- package/rules/typescript/ts.security.no-javascript-url.rule.yaml +42 -8
- package/rules/typescript/ts.security.no-native-prototype-extension.rule.yaml +13 -1
- package/rules/typescript/ts.security.non-literal-fs-filename.rule.yaml +13 -1
- package/rules/typescript/ts.security.observable-timing-discrepancy.rule.yaml +3 -3
- package/rules/typescript/ts.security.open-redirect.rule.yaml +6 -0
- package/rules/typescript/ts.security.path-join-user-input.rule.yaml +50 -0
- package/rules/typescript/ts.security.sensitive-data-written-to-file.rule.yaml +16 -6
- package/rules/typescript/ts.security.ssrf.rule.yaml +1 -0
- package/rules/typescript/ts.security.unsafe-dirname-path-concat.rule.yaml +3 -0
- package/rules/typescript/ts.security.unsanitized-http-response.rule.yaml +14 -3
- package/rules/typescript/ts.security.user-controlled-regexp.rule.yaml +52 -0
- package/rules/typescript/ts.testing.no-flaky-timer-test.rule.yaml +7 -7
- package/rules/typescript/ts.testing.no-legacy-test-waiter.rule.yaml +36 -0
- package/rules/typescript/ts.testing.no-network-call-in-unit-test.rule.yaml +7 -1
- package/rules/typescript/ts.testing.no-skipped-test-without-ticket.rule.yaml +3 -3
- package/rules/typescript/ts.testing.useless-assertion.rule.yaml +37 -0
- package/rules/typescript/ts.vue.emits-validator-return-boolean.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-browser-globals-in-created.rule.yaml +39 -0
- package/rules/typescript/ts.vue.no-computed-missing-dependency.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-computed-mutation.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-data-object-declaration.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-deprecated-keycodes-config.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-deprecated-listeners.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-deprecated-model-option.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-deprecated-scoped-slots.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-keycode-modifiers.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-reserved-key-overwrite.rule.yaml +36 -0
- package/rules/typescript/ts.vue.no-server-env-in-client-hooks.rule.yaml +39 -0
- package/rules/typescript/ts.vue.no-slot-property-access.rule.yaml +36 -0
- package/rules/typescript/ts.vue.prefer-prop-type-constructor.rule.yaml +36 -0
- package/rules/typescript/ts.vue.require-transition-conditional.rule.yaml +36 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.bug-risk.with-object-value-unused
|
|
5
|
+
title: with_object called but object value unused
|
|
6
|
+
summary: >-
|
|
7
|
+
`with_object` or `each_with_object` is called but the block only receives
|
|
8
|
+
one argument. The accumulated object is silently discarded.
|
|
9
|
+
rationale: >-
|
|
10
|
+
When `with_object` is used with a single-argument block, the memo object
|
|
11
|
+
is created but never used. Either use both arguments or use a plain
|
|
12
|
+
iteration method.
|
|
13
|
+
aliases:
|
|
14
|
+
- RB-LI1053
|
|
15
|
+
detection:
|
|
16
|
+
kind: pattern
|
|
17
|
+
tags:
|
|
18
|
+
- rules-catalog
|
|
19
|
+
- ruby
|
|
20
|
+
stability: stable
|
|
21
|
+
appliesTo: block
|
|
22
|
+
scope:
|
|
23
|
+
languages:
|
|
24
|
+
- ruby
|
|
25
|
+
paths:
|
|
26
|
+
include:
|
|
27
|
+
- "**/*.rb"
|
|
28
|
+
exclude:
|
|
29
|
+
- "**/vendor/**"
|
|
30
|
+
- "**/node_modules/**"
|
|
31
|
+
match:
|
|
32
|
+
fact:
|
|
33
|
+
kind: ruby.bug-risk.with-object-value-unused
|
|
34
|
+
bind: issue
|
|
35
|
+
emit:
|
|
36
|
+
finding:
|
|
37
|
+
category: correctness.language
|
|
38
|
+
severity: high
|
|
39
|
+
confidence: 0.85
|
|
40
|
+
tags:
|
|
41
|
+
- ruby
|
|
42
|
+
message:
|
|
43
|
+
title: Review `${captures.issue.text}`
|
|
44
|
+
summary: >-
|
|
45
|
+
"`${captures.issue.text}` matches
|
|
46
|
+
`ruby.bug-risk.with-object-value-unused`."
|
|
47
|
+
remediation:
|
|
48
|
+
summary: >-
|
|
49
|
+
Add a second block parameter to capture the accumulator object, or
|
|
50
|
+
replace with a plain `each` if no accumulator is needed.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.efficient-hash-search
|
|
5
|
+
title: Prefer `key?` and `value?` over `.keys.include?` and `.values.include?`
|
|
6
|
+
summary: >-
|
|
7
|
+
`.keys.include?(...)` and `.values.include?(...)` allocate a new array
|
|
8
|
+
of all keys or values before searching. Use `key?` or `has_value?` instead.
|
|
9
|
+
rationale: >-
|
|
10
|
+
Extracting all keys or values into an array before checking membership
|
|
11
|
+
allocates an O(n) array. Using `key?` or `has_value?` searches without
|
|
12
|
+
intermediate allocation.
|
|
13
|
+
aliases:
|
|
14
|
+
- RB-PR1012
|
|
15
|
+
tags:
|
|
16
|
+
- performance
|
|
17
|
+
- ruby
|
|
18
|
+
- rules-catalog
|
|
19
|
+
stability: experimental
|
|
20
|
+
appliesTo: block
|
|
21
|
+
scope:
|
|
22
|
+
languages:
|
|
23
|
+
- ruby
|
|
24
|
+
match:
|
|
25
|
+
fact:
|
|
26
|
+
kind: ruby.performance.efficient-hash-search
|
|
27
|
+
bind: issue
|
|
28
|
+
emit:
|
|
29
|
+
finding:
|
|
30
|
+
category: performance.lookup
|
|
31
|
+
severity: medium
|
|
32
|
+
confidence: 0.66
|
|
33
|
+
tags:
|
|
34
|
+
- performance
|
|
35
|
+
- ruby
|
|
36
|
+
message:
|
|
37
|
+
title: Use `key?` or `has_value?` instead of `.keys.include?`/`.values.include?`
|
|
38
|
+
summary: "`${captures.issue.text}` allocates a temporary array to search the hash."
|
|
39
|
+
remediation:
|
|
40
|
+
summary: >-
|
|
41
|
+
Replace `.keys.include?(k)` with `.key?(k)` and `.values.include?(v)`
|
|
42
|
+
with `.has_value?(v)` to avoid intermediate array allocation.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.enumerable-index-by
|
|
5
|
+
title: Use index_by instead of map+to_h to create a hash from an enumerable
|
|
6
|
+
summary: >-
|
|
7
|
+
Uses `.map { |e| [e.key, e] }.to_h` which can be replaced with
|
|
8
|
+
`.index_by(&:key)` for clearer intent and better performance.
|
|
9
|
+
rationale: >-
|
|
10
|
+
ActiveSupport's `Enumerable#index_by` is specifically designed for the
|
|
11
|
+
common pattern of creating a hash where keys are derived from each element.
|
|
12
|
+
It avoids creating an intermediate array and is more readable than the
|
|
13
|
+
equivalent `.map { |e| [e.key, e] }.to_h` pattern.
|
|
14
|
+
aliases:
|
|
15
|
+
- RB-RL1058
|
|
16
|
+
detection:
|
|
17
|
+
kind: pattern
|
|
18
|
+
tags:
|
|
19
|
+
- rules-catalog
|
|
20
|
+
- ruby
|
|
21
|
+
- performance
|
|
22
|
+
stability: stable
|
|
23
|
+
appliesTo: block
|
|
24
|
+
scope:
|
|
25
|
+
languages:
|
|
26
|
+
- ruby
|
|
27
|
+
paths:
|
|
28
|
+
include:
|
|
29
|
+
- "**/*.rb"
|
|
30
|
+
exclude:
|
|
31
|
+
- "**/vendor/**"
|
|
32
|
+
- "**/node_modules/**"
|
|
33
|
+
match:
|
|
34
|
+
fact:
|
|
35
|
+
kind: ruby.performance.enumerable-index-by
|
|
36
|
+
bind: issue
|
|
37
|
+
emit:
|
|
38
|
+
finding:
|
|
39
|
+
category: performance.allocation
|
|
40
|
+
severity: medium
|
|
41
|
+
confidence: 0.7
|
|
42
|
+
tags:
|
|
43
|
+
- performance
|
|
44
|
+
- ruby
|
|
45
|
+
message:
|
|
46
|
+
title: "Use `.index_by(&:key)` instead of `.map { |e| [e.key, e] }.to_h`"
|
|
47
|
+
summary: "'${captures.issue.text}' builds a hash from `.map` + `.to_h`. Use `.index_by(&:key)` for better performance and clarity."
|
|
48
|
+
remediation:
|
|
49
|
+
summary: >-
|
|
50
|
+
Replace `.map { |e| [e.key, e] }.to_h` with `.index_by(&:key)`.
|
|
51
|
+
If the value is not the element itself, use `.index_by { |e| e.key }.transform_values { |e| transform(e) }`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.enumerable-index-with
|
|
5
|
+
title: Use index_with instead of map+to_h to create a hash from an enumerable
|
|
6
|
+
summary: >-
|
|
7
|
+
Uses `.map { |e| [e, e.value] }.to_h` which can be replaced with
|
|
8
|
+
`.index_with(&:value)` for clearer intent and better performance.
|
|
9
|
+
rationale: >-
|
|
10
|
+
ActiveSupport's `Enumerable#index_with` is specifically designed for the
|
|
11
|
+
common pattern of creating a hash where elements are keys and values are
|
|
12
|
+
derived from each element. It avoids creating an intermediate array and is
|
|
13
|
+
more readable than the equivalent `.map { |e| [e, e.value] }.to_h` pattern.
|
|
14
|
+
aliases:
|
|
15
|
+
- RB-RL1059
|
|
16
|
+
detection:
|
|
17
|
+
kind: pattern
|
|
18
|
+
tags:
|
|
19
|
+
- rules-catalog
|
|
20
|
+
- ruby
|
|
21
|
+
- performance
|
|
22
|
+
stability: stable
|
|
23
|
+
appliesTo: block
|
|
24
|
+
scope:
|
|
25
|
+
languages:
|
|
26
|
+
- ruby
|
|
27
|
+
paths:
|
|
28
|
+
include:
|
|
29
|
+
- "**/*.rb"
|
|
30
|
+
exclude:
|
|
31
|
+
- "**/vendor/**"
|
|
32
|
+
- "**/node_modules/**"
|
|
33
|
+
match:
|
|
34
|
+
fact:
|
|
35
|
+
kind: ruby.performance.enumerable-index-with
|
|
36
|
+
bind: issue
|
|
37
|
+
emit:
|
|
38
|
+
finding:
|
|
39
|
+
category: performance.allocation
|
|
40
|
+
severity: medium
|
|
41
|
+
confidence: 0.7
|
|
42
|
+
tags:
|
|
43
|
+
- performance
|
|
44
|
+
- ruby
|
|
45
|
+
message:
|
|
46
|
+
title: "Use `.index_with(&:value)` instead of `.map { |e| [e, e.value] }.to_h`"
|
|
47
|
+
summary: "'${captures.issue.text}' builds a hash from `.map` + `.to_h`. Use `.index_with(&:value)` for better performance and clarity."
|
|
48
|
+
remediation:
|
|
49
|
+
summary: >-
|
|
50
|
+
Replace `.map { |e| [e, e.value] }.to_h` with `.index_with(&:value)`.
|
|
51
|
+
If the value expression is more complex than a simple attribute access,
|
|
52
|
+
use `.index_with { |e| complex_expression(e) }`.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.merge-single-key
|
|
5
|
+
title: Prefer direct assignment over `merge!` with a single key
|
|
6
|
+
summary: >-
|
|
7
|
+
`.merge!({key: value})` for a single key creates an intermediate hash.
|
|
8
|
+
Use direct assignment `self[:key] = value` instead.
|
|
9
|
+
rationale: >-
|
|
10
|
+
Creating a hash literal and passing it to `merge!` allocates a temporary
|
|
11
|
+
hash object. Direct key assignment avoids the intermediate allocation and
|
|
12
|
+
is more readable for single-key updates.
|
|
13
|
+
aliases:
|
|
14
|
+
- RB-PR1017
|
|
15
|
+
tags:
|
|
16
|
+
- performance
|
|
17
|
+
- ruby
|
|
18
|
+
- rules-catalog
|
|
19
|
+
stability: experimental
|
|
20
|
+
appliesTo: block
|
|
21
|
+
scope:
|
|
22
|
+
languages:
|
|
23
|
+
- ruby
|
|
24
|
+
match:
|
|
25
|
+
fact:
|
|
26
|
+
kind: ruby.performance.merge-single-key
|
|
27
|
+
bind: issue
|
|
28
|
+
emit:
|
|
29
|
+
finding:
|
|
30
|
+
category: performance.allocation
|
|
31
|
+
severity: medium
|
|
32
|
+
confidence: 0.66
|
|
33
|
+
tags:
|
|
34
|
+
- performance
|
|
35
|
+
- ruby
|
|
36
|
+
message:
|
|
37
|
+
title: Use direct assignment instead of single-key `merge!`
|
|
38
|
+
summary: "`${captures.issue.text}` creates a temporary hash for a single-key update. Use direct assignment."
|
|
39
|
+
remediation:
|
|
40
|
+
summary: >-
|
|
41
|
+
Replace `hash.merge!(key: value)` with `hash[:key] = value` to avoid
|
|
42
|
+
allocating a temporary hash object.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.no-static-size-computation
|
|
5
|
+
title: Avoid computing size of static arrays and hashes
|
|
6
|
+
summary: >-
|
|
7
|
+
Calling `.count`, `.size`, or `.length` on a static array or hash literal
|
|
8
|
+
computes a value known at parse-time. Prefer assigning the literal to a
|
|
9
|
+
constant or using the literal directly.
|
|
10
|
+
rationale: >-
|
|
11
|
+
Static collections have a fixed size known at compile time. Calling
|
|
12
|
+
`.count`/`.size`/`.length` on them adds unnecessary runtime overhead
|
|
13
|
+
compared to using the known constant value.
|
|
14
|
+
aliases:
|
|
15
|
+
- RB-PR1010
|
|
16
|
+
tags:
|
|
17
|
+
- performance
|
|
18
|
+
- ruby
|
|
19
|
+
- rules-catalog
|
|
20
|
+
stability: experimental
|
|
21
|
+
appliesTo: block
|
|
22
|
+
scope:
|
|
23
|
+
languages:
|
|
24
|
+
- ruby
|
|
25
|
+
match:
|
|
26
|
+
fact:
|
|
27
|
+
kind: ruby.performance.no-static-size-computation
|
|
28
|
+
bind: issue
|
|
29
|
+
emit:
|
|
30
|
+
finding:
|
|
31
|
+
category: performance.allocation
|
|
32
|
+
severity: medium
|
|
33
|
+
confidence: 0.66
|
|
34
|
+
tags:
|
|
35
|
+
- performance
|
|
36
|
+
- ruby
|
|
37
|
+
message:
|
|
38
|
+
title: Avoid calling `.count`/`.size`/`.length` on static collection
|
|
39
|
+
summary: "`${captures.issue.text}` computes the size of a static collection at runtime."
|
|
40
|
+
remediation:
|
|
41
|
+
summary: >-
|
|
42
|
+
Replace the dynamic size computation with the known literal value, or
|
|
43
|
+
assign the collection to a constant and reference its size directly.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.prefer-delete-prefix
|
|
5
|
+
title: Use delete_prefix instead of gsub with \A-anchored regex
|
|
6
|
+
summary: >-
|
|
7
|
+
Calling `gsub(/\Aprefix/, '')` compiles and runs a regex to strip a literal
|
|
8
|
+
prefix. `String#delete_prefix` is faster and clearer.
|
|
9
|
+
rationale: >-
|
|
10
|
+
Using `gsub` with a `\A`-anchored regex and an empty replacement string
|
|
11
|
+
to strip a prefix incurs regex compilation and matching overhead.
|
|
12
|
+
`String#delete_prefix` performs a simple string comparison, which is
|
|
13
|
+
significantly faster and more readable.
|
|
14
|
+
aliases:
|
|
15
|
+
- RB-PR1026
|
|
16
|
+
detection:
|
|
17
|
+
kind: pattern
|
|
18
|
+
tags:
|
|
19
|
+
- performance
|
|
20
|
+
- ruby
|
|
21
|
+
- rules-catalog
|
|
22
|
+
stability: experimental
|
|
23
|
+
appliesTo: block
|
|
24
|
+
scope:
|
|
25
|
+
languages:
|
|
26
|
+
- ruby
|
|
27
|
+
paths:
|
|
28
|
+
include:
|
|
29
|
+
- "**/*.rb"
|
|
30
|
+
exclude:
|
|
31
|
+
- "**/vendor/**"
|
|
32
|
+
- "**/node_modules/**"
|
|
33
|
+
match:
|
|
34
|
+
fact:
|
|
35
|
+
kind: ruby.performance.prefer-delete-prefix
|
|
36
|
+
bind: issue
|
|
37
|
+
emit:
|
|
38
|
+
finding:
|
|
39
|
+
category: performance.computation
|
|
40
|
+
severity: medium
|
|
41
|
+
confidence: 0.75
|
|
42
|
+
tags:
|
|
43
|
+
- performance
|
|
44
|
+
- ruby
|
|
45
|
+
message:
|
|
46
|
+
title: Replace `gsub(/\A.../, '')` with `delete_prefix`
|
|
47
|
+
summary: "'${captures.issue.text}' uses a regex to strip a prefix. Use `delete_prefix` instead."
|
|
48
|
+
remediation:
|
|
49
|
+
summary: >-
|
|
50
|
+
Replace `str.gsub(/\Aprefix/, '')` with `str.delete_prefix('prefix')`.
|
|
51
|
+
`delete_prefix` avoids regex overhead and expresses intent more clearly.
|
|
52
|
+
Note: `delete_prefix` only works for literal prefixes — verify the regex
|
|
53
|
+
body contains no metacharacters before applying this change.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.prefer-delete-suffix
|
|
5
|
+
title: Use delete_suffix instead of gsub with \z-anchored regex
|
|
6
|
+
summary: >-
|
|
7
|
+
Calling `gsub(/suffix\z/, '')` compiles and runs a regex to strip a literal
|
|
8
|
+
suffix. `String#delete_suffix` is faster and clearer.
|
|
9
|
+
rationale: >-
|
|
10
|
+
Using `gsub` with a `\z`-anchored regex and an empty replacement string
|
|
11
|
+
to strip a suffix incurs regex compilation and matching overhead.
|
|
12
|
+
`String#delete_suffix` performs a simple string comparison, which is
|
|
13
|
+
significantly faster and more readable.
|
|
14
|
+
aliases:
|
|
15
|
+
- RB-PR1027
|
|
16
|
+
detection:
|
|
17
|
+
kind: pattern
|
|
18
|
+
tags:
|
|
19
|
+
- performance
|
|
20
|
+
- ruby
|
|
21
|
+
- rules-catalog
|
|
22
|
+
stability: experimental
|
|
23
|
+
appliesTo: block
|
|
24
|
+
scope:
|
|
25
|
+
languages:
|
|
26
|
+
- ruby
|
|
27
|
+
paths:
|
|
28
|
+
include:
|
|
29
|
+
- "**/*.rb"
|
|
30
|
+
exclude:
|
|
31
|
+
- "**/vendor/**"
|
|
32
|
+
- "**/node_modules/**"
|
|
33
|
+
match:
|
|
34
|
+
fact:
|
|
35
|
+
kind: ruby.performance.prefer-delete-suffix
|
|
36
|
+
bind: issue
|
|
37
|
+
emit:
|
|
38
|
+
finding:
|
|
39
|
+
category: performance.computation
|
|
40
|
+
severity: medium
|
|
41
|
+
confidence: 0.75
|
|
42
|
+
tags:
|
|
43
|
+
- performance
|
|
44
|
+
- ruby
|
|
45
|
+
message:
|
|
46
|
+
title: Replace `gsub(/...\z/, '')` with `delete_suffix`
|
|
47
|
+
summary: "'${captures.issue.text}' uses a regex to strip a suffix. Use `delete_suffix` instead."
|
|
48
|
+
remediation:
|
|
49
|
+
summary: >-
|
|
50
|
+
Replace `str.gsub(/suffix\z/, '')` with `str.delete_suffix('suffix')`.
|
|
51
|
+
`delete_suffix` avoids regex overhead and expresses intent more clearly.
|
|
52
|
+
Note: `delete_suffix` only works for literal suffixes — verify the regex
|
|
53
|
+
body contains no metacharacters before applying this change.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.prefer-flat-map
|
|
5
|
+
title: Prefer `flat_map` over `map { ... }.flatten`
|
|
6
|
+
summary: >-
|
|
7
|
+
`.map { ... }.flatten` iterates the collection and then flattens the result
|
|
8
|
+
in a second pass. `flat_map` combines both operations in a single pass.
|
|
9
|
+
rationale: >-
|
|
10
|
+
Using `.flat_map` instead of `.map { ... }.flatten` avoids an intermediate
|
|
11
|
+
array allocation and a second iteration, reducing memory and CPU overhead.
|
|
12
|
+
aliases:
|
|
13
|
+
- RB-PR1011
|
|
14
|
+
tags:
|
|
15
|
+
- performance
|
|
16
|
+
- ruby
|
|
17
|
+
- rules-catalog
|
|
18
|
+
stability: experimental
|
|
19
|
+
appliesTo: block
|
|
20
|
+
scope:
|
|
21
|
+
languages:
|
|
22
|
+
- ruby
|
|
23
|
+
match:
|
|
24
|
+
fact:
|
|
25
|
+
kind: ruby.performance.prefer-flat-map
|
|
26
|
+
bind: issue
|
|
27
|
+
emit:
|
|
28
|
+
finding:
|
|
29
|
+
category: performance.allocation
|
|
30
|
+
severity: medium
|
|
31
|
+
confidence: 0.66
|
|
32
|
+
tags:
|
|
33
|
+
- performance
|
|
34
|
+
- ruby
|
|
35
|
+
message:
|
|
36
|
+
title: Replace `.map { ... }.flatten` with `flat_map`
|
|
37
|
+
summary: "`${captures.issue.text}` chains `.map` and `.flatten`. Use `.flat_map` instead."
|
|
38
|
+
remediation:
|
|
39
|
+
summary: >-
|
|
40
|
+
Replace `.map { ... }.flatten` with `.flat_map { ... }` to combine
|
|
41
|
+
mapping and flattening in a single pass.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.prefer-struct-over-openstruct
|
|
5
|
+
title: Prefer `Struct` over `OpenStruct`
|
|
6
|
+
summary: >-
|
|
7
|
+
`OpenStruct.new` is significantly slower and more memory-intensive than
|
|
8
|
+
`Struct.new` for fixed-schema data objects.
|
|
9
|
+
rationale: >-
|
|
10
|
+
OpenStruct uses `define_method` dynamically and stores data in a hash,
|
|
11
|
+
making it slower to create and access. For fixed-schema objects, Struct
|
|
12
|
+
provides better performance and type safety.
|
|
13
|
+
aliases:
|
|
14
|
+
- RB-PR1013
|
|
15
|
+
tags:
|
|
16
|
+
- performance
|
|
17
|
+
- ruby
|
|
18
|
+
- rules-catalog
|
|
19
|
+
stability: experimental
|
|
20
|
+
appliesTo: block
|
|
21
|
+
scope:
|
|
22
|
+
languages:
|
|
23
|
+
- ruby
|
|
24
|
+
match:
|
|
25
|
+
fact:
|
|
26
|
+
kind: ruby.performance.prefer-struct-over-openstruct
|
|
27
|
+
bind: issue
|
|
28
|
+
emit:
|
|
29
|
+
finding:
|
|
30
|
+
category: performance.allocation
|
|
31
|
+
severity: medium
|
|
32
|
+
confidence: 0.66
|
|
33
|
+
tags:
|
|
34
|
+
- performance
|
|
35
|
+
- ruby
|
|
36
|
+
message:
|
|
37
|
+
title: Replace `OpenStruct` with `Struct` for fixed-schema data
|
|
38
|
+
summary: "`${captures.issue.text}` creates an OpenStruct which is slower and more memory-intensive than Struct."
|
|
39
|
+
remediation:
|
|
40
|
+
summary: >-
|
|
41
|
+
Replace `OpenStruct.new(...)` with `Struct.new(...)` or a dedicated
|
|
42
|
+
class definition for better performance and type safety.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.range-cover-over-include
|
|
5
|
+
title: Prefer `cover?` over `include?` for range membership
|
|
6
|
+
summary: >-
|
|
7
|
+
`Range#include?` iterates the range to check membership, while
|
|
8
|
+
`Range#cover?` uses a simple comparison. For numeric ranges, `cover?`
|
|
9
|
+
is significantly faster.
|
|
10
|
+
rationale: >-
|
|
11
|
+
`include?` on a Range checks each element sequentially for contiguous
|
|
12
|
+
numeric ranges, while `cover?` simply compares against the endpoints.
|
|
13
|
+
`cover?` is O(1) versus O(n) for `include?` on large ranges.
|
|
14
|
+
aliases:
|
|
15
|
+
- RB-PR1014
|
|
16
|
+
tags:
|
|
17
|
+
- performance
|
|
18
|
+
- ruby
|
|
19
|
+
- rules-catalog
|
|
20
|
+
stability: experimental
|
|
21
|
+
appliesTo: block
|
|
22
|
+
scope:
|
|
23
|
+
languages:
|
|
24
|
+
- ruby
|
|
25
|
+
match:
|
|
26
|
+
fact:
|
|
27
|
+
kind: ruby.performance.range-cover-over-include
|
|
28
|
+
bind: issue
|
|
29
|
+
emit:
|
|
30
|
+
finding:
|
|
31
|
+
category: performance.allocation
|
|
32
|
+
severity: medium
|
|
33
|
+
confidence: 0.66
|
|
34
|
+
tags:
|
|
35
|
+
- performance
|
|
36
|
+
- ruby
|
|
37
|
+
message:
|
|
38
|
+
title: Use `cover?` instead of `include?` for range membership checks
|
|
39
|
+
summary: "`${captures.issue.text}` uses `include?` on a Range. Use `cover?` for O(1) comparison."
|
|
40
|
+
remediation:
|
|
41
|
+
summary: >-
|
|
42
|
+
Replace `range.include?(value)` with `range.cover?(value)` for
|
|
43
|
+
numeric or string ranges to use endpoint comparison instead of iteration.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.regex-match-over-match
|
|
5
|
+
title: Prefer `match?` over `match` for boolean checks
|
|
6
|
+
summary: >-
|
|
7
|
+
`.match(...)` used as a boolean condition allocates a MatchData object.
|
|
8
|
+
Use `.match?(...)` or `===` instead when the match result is not needed.
|
|
9
|
+
rationale: >-
|
|
10
|
+
`String#match` returns a MatchData object, incurring allocation overhead.
|
|
11
|
+
`String#match?` (Ruby 2.4+) returns a boolean without allocating, and is
|
|
12
|
+
significantly faster when only a boolean check is needed.
|
|
13
|
+
aliases:
|
|
14
|
+
- RB-PR1016
|
|
15
|
+
tags:
|
|
16
|
+
- performance
|
|
17
|
+
- ruby
|
|
18
|
+
- rules-catalog
|
|
19
|
+
stability: experimental
|
|
20
|
+
appliesTo: block
|
|
21
|
+
scope:
|
|
22
|
+
languages:
|
|
23
|
+
- ruby
|
|
24
|
+
match:
|
|
25
|
+
fact:
|
|
26
|
+
kind: ruby.performance.regex-match-over-match
|
|
27
|
+
bind: issue
|
|
28
|
+
emit:
|
|
29
|
+
finding:
|
|
30
|
+
category: performance.computation
|
|
31
|
+
severity: medium
|
|
32
|
+
confidence: 0.66
|
|
33
|
+
tags:
|
|
34
|
+
- performance
|
|
35
|
+
- ruby
|
|
36
|
+
message:
|
|
37
|
+
title: Use `match?` instead of `match` for boolean checks
|
|
38
|
+
summary: "`${captures.issue.text}` uses `.match()` in a condition. Use `.match?()` to avoid MatchData allocation."
|
|
39
|
+
remediation:
|
|
40
|
+
summary: >-
|
|
41
|
+
Replace `.match(/pattern/)` with `.match?(/pattern/)` when the match
|
|
42
|
+
result is not captured, to avoid MatchData allocation overhead.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.performance.yield-over-block-call
|
|
5
|
+
title: Prefer `yield` over explicit `block.call`
|
|
6
|
+
summary: >-
|
|
7
|
+
Methods that accept a block with `&block` and call it via `block.call`
|
|
8
|
+
should use implicit `yield` instead for better performance.
|
|
9
|
+
rationale: >-
|
|
10
|
+
Using `yield` is faster than capturing a block into a proc and calling
|
|
11
|
+
`.call` because it avoids proc allocation and method dispatch overhead.
|
|
12
|
+
aliases:
|
|
13
|
+
- RB-PR1015
|
|
14
|
+
tags:
|
|
15
|
+
- performance
|
|
16
|
+
- ruby
|
|
17
|
+
- rules-catalog
|
|
18
|
+
stability: experimental
|
|
19
|
+
appliesTo: block
|
|
20
|
+
scope:
|
|
21
|
+
languages:
|
|
22
|
+
- ruby
|
|
23
|
+
match:
|
|
24
|
+
fact:
|
|
25
|
+
kind: ruby.performance.yield-over-block-call
|
|
26
|
+
bind: issue
|
|
27
|
+
emit:
|
|
28
|
+
finding:
|
|
29
|
+
category: performance.computation
|
|
30
|
+
severity: medium
|
|
31
|
+
confidence: 0.5
|
|
32
|
+
tags:
|
|
33
|
+
- performance
|
|
34
|
+
- ruby
|
|
35
|
+
message:
|
|
36
|
+
title: Use `yield` instead of `block.call`
|
|
37
|
+
summary: "`${captures.issue.text}` captures a block and calls it explicitly. Use implicit `yield`."
|
|
38
|
+
remediation:
|
|
39
|
+
summary: >-
|
|
40
|
+
Remove the `&block` parameter and use implicit `yield` to invoke the
|
|
41
|
+
block, avoiding proc allocation and call overhead.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
apiVersion: critiq.dev/v1alpha1
|
|
2
|
+
kind: Rule
|
|
3
|
+
metadata:
|
|
4
|
+
id: ruby.security.io-shell-command
|
|
5
|
+
title: Avoid IO class reads that may invoke shell commands
|
|
6
|
+
summary: >-
|
|
7
|
+
IO.read and related IO class methods can spawn subprocesses when the path starts with a pipe.
|
|
8
|
+
rationale: >-
|
|
9
|
+
IO.read and related IO class methods can spawn subprocesses when the path starts with a pipe.
|
|
10
|
+
detection:
|
|
11
|
+
kind: pattern
|
|
12
|
+
references:
|
|
13
|
+
- kind: cwe
|
|
14
|
+
id: CWE-78
|
|
15
|
+
title: Improper Neutralization of Special Elements used in an OS Command
|
|
16
|
+
- kind: url
|
|
17
|
+
title: RuboCop Security/IoMethods
|
|
18
|
+
url: https://docs.rubocop.org/rubocop/cops_security.html#securityiometrics
|
|
19
|
+
tags:
|
|
20
|
+
- security
|
|
21
|
+
- rules-catalog
|
|
22
|
+
- ruby
|
|
23
|
+
stability: stable
|
|
24
|
+
appliesTo: block
|
|
25
|
+
scope:
|
|
26
|
+
languages:
|
|
27
|
+
- ruby
|
|
28
|
+
paths:
|
|
29
|
+
include:
|
|
30
|
+
- "**/*.rb"
|
|
31
|
+
exclude:
|
|
32
|
+
- "**/vendor/**"
|
|
33
|
+
- "**/node_modules/**"
|
|
34
|
+
match:
|
|
35
|
+
fact:
|
|
36
|
+
kind: ruby.security.io-shell-command
|
|
37
|
+
bind: issue
|
|
38
|
+
emit:
|
|
39
|
+
finding:
|
|
40
|
+
category: security.command-injection
|
|
41
|
+
severity: critical
|
|
42
|
+
confidence: 0.9
|
|
43
|
+
tags:
|
|
44
|
+
- ruby
|
|
45
|
+
message:
|
|
46
|
+
title: Review `${captures.issue.text}`
|
|
47
|
+
summary: "`${captures.issue.text}` matches `ruby.security.io-shell-command`."
|
|
48
|
+
remediation:
|
|
49
|
+
summary: >-
|
|
50
|
+
IO.read and related IO class methods can spawn subprocesses when the path starts with a pipe.
|