| Conditions | 9 | 
| Total Lines | 60 | 
| Code Lines | 45 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | package com.hltech.vaunt.validator;  | 
            ||
| 13 |     public static List<String> validate(JsonSchema consumerSchema, JsonSchema providerSchema) { | 
            ||
| 14 | List<String> errors = new ArrayList<>();  | 
            ||
| 15 | |||
| 16 |         if (!equals(consumerSchema.get$ref(), providerSchema.get$ref())) { | 
            ||
| 17 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 18 | consumerSchema.getId(),  | 
            ||
| 19 | "$ref",  | 
            ||
| 20 | consumerSchema.get$ref(),  | 
            ||
| 21 | providerSchema.get$ref()));  | 
            ||
| 22 | }  | 
            ||
| 23 | |||
| 24 |         if (!equals(consumerSchema.get$schema(), providerSchema.get$schema())) { | 
            ||
| 25 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 26 | consumerSchema.getId(),  | 
            ||
| 27 | "$schema",  | 
            ||
| 28 | consumerSchema.get$schema(),  | 
            ||
| 29 | providerSchema.get$schema()));  | 
            ||
| 30 | }  | 
            ||
| 31 | |||
| 32 |         if (!arraysEquals(consumerSchema.getDisallow(), providerSchema.getDisallow())) { | 
            ||
| 33 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 34 | consumerSchema.getId(),  | 
            ||
| 35 | "disallow",  | 
            ||
| 36 | jsonArrayToString(consumerSchema.getDisallow()),  | 
            ||
| 37 | jsonArrayToString(providerSchema.getDisallow())));  | 
            ||
| 38 | }  | 
            ||
| 39 | |||
| 40 |         if (!arraysEquals(consumerSchema.getExtends(), providerSchema.getExtends())) { | 
            ||
| 41 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 42 | consumerSchema.getId(),  | 
            ||
| 43 | "extends",  | 
            ||
| 44 | jsonArrayToString(consumerSchema.getExtends()),  | 
            ||
| 45 | jsonArrayToString(providerSchema.getExtends())));  | 
            ||
| 46 | }  | 
            ||
| 47 | |||
| 48 |         if (isRequired(consumerSchema) && !isRequired(providerSchema)) { | 
            ||
| 49 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 50 | consumerSchema.getId(),  | 
            ||
| 51 | "required",  | 
            ||
| 52 | consumerSchema.getRequired(),  | 
            ||
| 53 | providerSchema.getRequired()));  | 
            ||
| 54 | }  | 
            ||
| 55 | |||
| 56 |         if (!equals(consumerSchema.getReadonly(), providerSchema.getReadonly())) { | 
            ||
| 57 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 58 | consumerSchema.getId(),  | 
            ||
| 59 | "readonly",  | 
            ||
| 60 | consumerSchema.getReadonly(),  | 
            ||
| 61 | providerSchema.getReadonly()));  | 
            ||
| 62 | }  | 
            ||
| 63 | |||
| 64 |         if (!equals(consumerSchema.getDescription(), providerSchema.getDescription())) { | 
            ||
| 65 | errors.add(String.format(ERROR_FORMAT,  | 
            ||
| 66 | consumerSchema.getId(),  | 
            ||
| 67 | "description",  | 
            ||
| 68 | consumerSchema.getDescription(),  | 
            ||
| 69 | providerSchema.getDescription()));  | 
            ||
| 70 | }  | 
            ||
| 71 | |||
| 72 | return errors;  | 
            ||
| 73 | }  | 
            ||
| 123 |