...
Description | Bad | Good | |
---|---|---|---|
1 | Don't forget to check the copyright (add/modify new calendar year to existing copyright if needed) | * Copyright (C) 20201 2020 Other Company | * Copyright (C) 2021 Other Company * Modifications Copyright (C) 2021-2022 Nordix Foundation |
2 | Don't forget to check the commit message structure | It is following ONAP commit message guidelines: Commit Messages#CommitStructure | |
3 | Overuse of constant for string literals (that don't add value) Also duplication is not a good reason, it often 'smells like' a method that should be extracted out instead |
|
|
4 | Avoid using ! when else block is implemented |
| if (x==null) { |
5 | No need for else after return statement |
| if (x==true) { return something; |
6 | No need to check for not empty before iterating on collection | if (!myCollection.isEmpty()) { collection.forEach(some action); | collection.forEach(some action); |
7 | No unnecessary test data Try to minimize the test data to just the data needed for the use case under test (often test data from other test is copied and pasted into new test that simply don't need it) |
| def 'Registration with invalid cm handle name'() { |
8 | Do not use 'var'. Explicitly define object types instead of just using var | var dataspaceEntity = dataspaceRepository.getByName(dataspaceName); | DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName); |
9 | Maven dependencies should be defined in Version Management *Note. CPS(core) project has a separate |
|
|
...