Archive
Code Reliability
-
phpinfo() should not be used in production
For security purpose, developers should not leave phpinfo() in production code, as it displays information which can be used to compromise the server that…
-
The code contains too many PHP4 deprecated constructor naming.
Developers should avoid using deprecated constructors. Since PHP5, constructor should be named __construct.
-
Force casts should not be used
Because force casting (as!) does not perform any type safety validations, it is capable of performing dangerous conversions between unrelated types. When the types…
-
Multiline string literals should not be used
Continuing a string across a linebreak is supported in most script engines, but it is not a part of ECMAScript. Additionally, the whitespace at…
-
Logical OR should not be used in switch cases
The logical OR operator (||) will not work in a switch case as one might think, only the first argument will be considered at…
-
try! should not be used
The use of Swift 2.0βs try! lets you execute code that might throw an exception without using the do and catch syntax normally required…
-
Avoid generic catch
You should not ignore exceptions. It can be tempting to be lazy when catching exceptions and do something like this: (see example below).
-
Avoid to update static fields from instance methods
Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple…
-
Avoid Public finalize() methods
A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone…
-
Avoid confusing initialization for variables declared on the same line
Destructuring assignment are a practical sugar syntax, but due to dynamic typing, ommitting the parentheses lead to a syntactically correct, but however functionnally incorrect,…