Dev/connection impl #78
Annotations
9 errors and 10 warnings
|
Return an empty collection rather than null.:
src/main/java/uk/gov/hmcts/cp/utils/Utils.java#L33
For any method that returns an collection (such as an array, Collection or Map), it is better to return
an empty one rather than a null reference. This removes the need for null checking all results and avoids
inadvertent NullPointerExceptions.
See Effective Java, 3rd Edition, Item 54: Return empty collections or arrays instead of null
ReturnEmptyCollectionRatherThanNull (Priority: 1, Ruleset: Error Prone)
https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#returnemptycollectionratherthannull
|
|
The constant name 'log' doesn't match '[A-Z][A-Z_0-9]*':
src/main/java/uk/gov/hmcts/cp/utils/Utils.java#L20
Configurable naming conventions for field declarations. This rule reports variable declarations
which do not match the regex that applies to their specific kind ---e.g. constants (static final),
enum constant, final field. Each regex can be configured through properties.
By default this rule uses the standard Java naming convention (Camel case), and uses the ALL_UPPER
convention for constants and enum constants.
FieldNamingConventions (Priority: 1, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#fieldnamingconventions
|
|
Return an empty collection rather than null.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L107
For any method that returns an collection (such as an array, Collection or Map), it is better to return
an empty one rather than a null reference. This removes the need for null checking all results and avoids
inadvertent NullPointerExceptions.
See Effective Java, 3rd Edition, Item 54: Return empty collections or arrays instead of null
ReturnEmptyCollectionRatherThanNull (Priority: 1, Ruleset: Error Prone)
https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#returnemptycollectionratherthannull
|
|
Logger calls should be surrounded by log level guards.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L105
Whenever using a log level, one should check if it is actually enabled, or
otherwise skip the associate String creation and manipulation, as well as any method calls.
An alternative to checking the log level are substituting parameters, formatters or lazy logging
with lambdas. The available alternatives depend on the actual logging framework.
GuardLogStatement (Priority: 2, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#guardlogstatement
|
|
Logger calls should be surrounded by log level guards.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L102
Whenever using a log level, one should check if it is actually enabled, or
otherwise skip the associate String creation and manipulation, as well as any method calls.
An alternative to checking the log level are substituting parameters, formatters or lazy logging
with lambdas. The available alternatives depend on the actual logging framework.
GuardLogStatement (Priority: 2, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#guardlogstatement
|
|
Return an empty collection rather than null.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L92
For any method that returns an collection (such as an array, Collection or Map), it is better to return
an empty one rather than a null reference. This removes the need for null checking all results and avoids
inadvertent NullPointerExceptions.
See Effective Java, 3rd Edition, Item 54: Return empty collections or arrays instead of null
ReturnEmptyCollectionRatherThanNull (Priority: 1, Ruleset: Error Prone)
https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#returnemptycollectionratherthannull
|
|
Logger calls should be surrounded by log level guards.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L91
Whenever using a log level, one should check if it is actually enabled, or
otherwise skip the associate String creation and manipulation, as well as any method calls.
An alternative to checking the log level are substituting parameters, formatters or lazy logging
with lambdas. The available alternatives depend on the actual logging framework.
GuardLogStatement (Priority: 2, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#guardlogstatement
|
|
Logger calls should be surrounded by log level guards.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L66
Whenever using a log level, one should check if it is actually enabled, or
otherwise skip the associate String creation and manipulation, as well as any method calls.
An alternative to checking the log level are substituting parameters, formatters or lazy logging
with lambdas. The available alternatives depend on the actual logging framework.
GuardLogStatement (Priority: 2, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#guardlogstatement
|
|
Annotate this interface with @FunctionalInterface or with @SuppressWarnings("PMD.ImplicitFunctionalInterface") to clarify your intent.:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClient.java#L6
Reports functional interfaces that were not explicitly declared as such with
the annotation `@FunctionalInterface`. If an interface is accidentally a functional
interface, then it should bear a `@SuppressWarnings("PMD.ImplicitFunctionalInterface")`
annotation to make this clear.
ImplicitFunctionalInterface (Priority: 2, Ruleset: Best Practices)
https://docs.pmd-code.org/snapshot/pmd_rules_java_bestpractices.html#implicitfunctionalinterface
|
|
Parameter 'caseId' is not assigned and could be declared final:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L77
Reports method and constructor parameters that can be made final because they are never reassigned within the body of the method.
This rule ignores unused parameters so as not to overlap with the rule {% rule java/bestpractices/UnusedFormalParameter %}.
It will also ignore the parameters of abstract methods.
MethodArgumentCouldBeFinal (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#methodargumentcouldbefinal
|
|
Local variable 'hearingList' could be declared final:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L65
A local variable assigned only once can be declared final.
LocalVariableCouldBeFinal (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#localvariablecouldbefinal
|
|
Parameter 'cjscppuid' is not assigned and could be declared final:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L50
Reports method and constructor parameters that can be made final because they are never reassigned within the body of the method.
This rule ignores unused parameters so as not to overlap with the rule {% rule java/bestpractices/UnusedFormalParameter %}.
It will also ignore the parameters of abstract methods.
MethodArgumentCouldBeFinal (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#methodargumentcouldbefinal
|
|
Parameter 'courtScheduleClientUrl' is not assigned and could be declared final:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L49
Reports method and constructor parameters that can be made final because they are never reassigned within the body of the method.
This rule ignores unused parameters so as not to overlap with the rule {% rule java/bestpractices/UnusedFormalParameter %}.
It will also ignore the parameters of abstract methods.
MethodArgumentCouldBeFinal (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#methodargumentcouldbefinal
|
|
Parameter 'httpClient' is not assigned and could be declared final:
src/main/java/uk/gov/hmcts/cp/repositories/CourtScheduleClientImpl.java#L48
Reports method and constructor parameters that can be made final because they are never reassigned within the body of the method.
This rule ignores unused parameters so as not to overlap with the rule {% rule java/bestpractices/UnusedFormalParameter %}.
It will also ignore the parameters of abstract methods.
MethodArgumentCouldBeFinal (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#methodargumentcouldbefinal
|
|
Avoid short class names like Type:
src/main/java/uk/gov/hmcts/cp/domain/HearingResponse.java#L41
Short Classnames with fewer than e.g. five characters are not recommended.
ShortClassName (Priority: 4, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#shortclassname
|
|
The field 'type' of serializable class 'uk.gov.hmcts.cp.domain.HearingResponse$HearingResult' is of non-serializable type 'uk.gov.hmcts.cp.domain.HearingResponse$HearingResult$Type'.:
src/main/java/uk/gov/hmcts/cp/domain/HearingResponse.java#L32
If a class is marked as `Serializable`, then all fields need to be serializable as well. In order to exclude
a field, it can be marked as transient. Static fields are not considered.
This rule reports all fields, that are not serializable.
If a class implements the methods to perform manual serialization (`writeObject`, `readObject`) or uses
a replacement object (`writeReplace`, `readResolve`) then this class is ignored.
Note: This rule has been revamped with PMD 6.52.0. It was previously called "BeanMembersShouldSerialize".
The property `prefix` has been deprecated, since in a serializable class all fields have to be
serializable regardless of the name.
NonSerializableClass (Priority: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#nonserializableclass
|
|
Avoid variables with short names like id:
src/main/java/uk/gov/hmcts/cp/domain/HearingResponse.java#L31
Fields, local variables, enum constant names or parameter names that are very short are not helpful to the reader.
ShortVariable (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#shortvariable
|
|
Classes implementing Serializable should set a serialVersionUID:
src/main/java/uk/gov/hmcts/cp/domain/HearingResponse.java#L27
Serializable classes should provide a serialVersionUID field.
The serialVersionUID field is also needed for abstract base classes. Each individual class in the inheritance
chain needs an own serialVersionUID field. See also [Should an abstract class have a serialVersionUID](https://stackoverflow.com/questions/893259/should-an-abstract-class-have-a-serialversionuid).
MissingSerialVersionUID (Priority: 3, Ruleset: Error Prone)
https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#missingserialversionuid
|
|
Local variable 'caseId' could be declared final:
src/main/java/uk/gov/hmcts/cp/controllers/CourtScheduleController.java#L34
A local variable assigned only once can be declared final.
LocalVariableCouldBeFinal (Priority: 3, Ruleset: Code Style)
https://docs.pmd-code.org/snapshot/pmd_rules_java_codestyle.html#localvariablecouldbefinal
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
PMD Report
Expired
|
5.99 KB |
sha256:8f99da8088ddf3b4bacda9eb681359b4344b71ddaf12721b09970b591a4f91aa
|
|