Is your feature request related to a problem? Please describe.
Currently violations have a couple of methods like getPackageName, getMethodName:
/** * Get the package name of the Class in which this violation was identified. * * @return The package name. */ // TODO Isn't this Java specific? String getPackageName(); /** * Get the name of the Class in which this violation was identified. * * @return The Class name. */ // TODO Isn't this Java specific? String getClassName(); /** * Get the method name in which this violation was identified. * * @return The method name. */ // TODO Isn't this Java specific? String getMethodName(); /** * Get the variable name on which this violation was identified. * * @return The variable name. */ String getVariableName();These are mostly Java-specific and the way this data is filled-in is very awkward: we have a JavaRuleViolation subclass of RuleViolation that initializes the fields in its constructor. To create a JavaRuleViolation we need a RuleViolationFactory instance which is mostly redundant.
The problems with this design are
Describe the solution you'd like
Map<String, String> getAdditionalInfo()
in RuleViolation. Standard keys like PACKAGE_NAME and CLASS_NAME can be exposed as constants in the RuleViolation interface.ViolationDecorator
whose job is to add extra attributes to the map. Use that in RuleContext when we create a new violationDescribe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
nspmd.reporting
package, like ViolationSuppressorRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4