Skip to content

[core] Allow numeric properties in XML to be within an unbounded range #1204

@oowekyala

Description

@oowekyala

Report thresholds for metrics for example usually only have the constraint that they must be positive. It makes no sense to artificially restrict that, and it obliges us to take an arbitrary decision ("is 2000 enough? should I add a zero?"). We could add some methods mustBeAbove and mustBeBelow to the property builders and implement some logic in the NumericPropertyModule to have unbounded intervals.

  • When defining a property programmatically, one can use NumericConstraint.positive()
  • But when defining a property in XML, you always have to provide min and max:
<property name="intProp" type="Integer" value="3" min="1" max="20" description="An IntegerProperty."/>
  • this will always build a range constraint

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions