networknt / json-schema-validator

A fast Java JSON schema validator that supports draft V4, V6, V7, V2019-09 and V2020-12
Apache License 2.0
807 stars 320 forks source link

Resolved smells. #1002

Closed meer1616 closed 3 months ago

meer1616 commented 3 months ago

Fix the implementation smells in ExclusiveMaximumValidator.java by reducing complex condition and segregating them into different methods, added another method called addFieldsToMappingWithCheck in BaseJsonValidator class, which adds the field to mapping by doing some null checking which reduces the cyclomatic complexity of registerAndMergeDiscriminator method, and make it clear and understandable and Lastly changed the method name from "from" to "extractSchemaRefFromSchema" in JsonSchemaRef which makes it more descriptive. The method name explains what it does and helps the new contributor understand the method's purpose without going through the whole code.