This target doesn't match any syntactical elements. It is used as an option from another target. In case you want to search for integers in code, take a look at literal.
Sensei allows some simple matching for integer values.
When wanting to match a specific value, the simple shorthand can be used.
search: literal: integerValue: 4
Performs an equality check. Only configuring this option behaves the same as using the shorthand notation.
search: literal: integerValue: is: 4
Matches any integer value less than the given value.
search: literal: integerValue: lessThan: 4
Matches any integer value less than or equals to the given value.
search: literal: integerValue: lessThanOrEquals: 4
Matches any integer value greater than the given value.
search: literal: integerValue: greaterThan: 4
This option was named
biggerThan until Sensei version 2021.1.
The following options are generic and available for every target.
Similar to the logical operator OR: one or more descendant options should match.
search: <target>: anyOf: - name: "illegal" - name: "alsoIllegal"
Similar to the logical operator AND: all descendant options must match.
search: <target>: allOf: - annotation: "HttpPost" - annotation: "AllowUnAuthorized"
The only purpose to use this field is to make the recipe easier to read. It provides no additional functionality.
search: <target>: with: annotation: "HttpPost"
Works as the logical operator NOT. It will negate the result of the descendant options. Sensei presents the
user with both options. They display the same behavior, but certain scenarios tend to read better using
search: <target>: not: annotation: "HttpPost"
search: <target>: without: annotation: "HttpPost"
Performs a structural search, this option is mainly used to narrow down recipes. Examples of this would be to only analyze and mark code inside a certain class or method that has a specific annotation. However, we haven't limited this option to only support these two scenarios. More advanced configuration can be achieved.
search: <target>: in: class: name: contains: "Controller"
search: <target>: in: method: annotation: type: "HttpPost"
Labels do not modify the behavior of searching elements, but they allow addressing a specific element in a quick fix.
search: element: tagName: inner attribute: name: data in: element: label: outerelement availableFixes: - name: add the 'type' attribute on the outer element actions: - add: attribute: name: type value: '"unsafe"' target: label:outerelement
- <outer> + <outer type="unsafe"> <inner data="test"/> </outer>