...
Common Mishaps
# | Description | Bad | Good |
---|---|---|---|
1 | Don't forget to check the copyright (add/modify new calendar year to existing copyright if needed) | /* * ============LICENSE_START======================================================= * Copyright (C) 2021 Other Company * Modifications Copyright (C) 2021-2022 Nordix Foundation | |
2 | 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 |
|
|
32 | Avoid using ! when else block is implemented |
| if (x==null) { report error } else { do something } |
34 | No need for else after return statement |
| if (x==true) { return something; |