Release 4.1.0.
[htmlpurifier.git] / docs / dev-code-quality.txt
blobbceedebc42ecf0bb8390e0d5b6a54a24c401cbc2
2 Code Quality Issues
4 Okay, face it.  Programmers can get lazy, cut corners, or make mistakes. They
5 also can do quick prototypes, and then forget to rewrite them later.  Well,
6 while I can't list mistakes in here, I can list prototype-like segments
7 of code that should be aggressively refactored.  This does not list
8 optimization issues, that needs to be done after intense profiling.
10 docs/examples/demo.php - ad hoc HTML/PHP soup to the extreme
12 AttrDef - a lot of duplication, more generic classes need to be created;
13 a lot of strtolower() calls, no legit casing
14     Class - doesn't support Unicode characters (fringe); uses regular expressions
15     Lang - code duplication; premature optimization
16     Length - easily mistaken for CSSLength
17     URI - multiple regular expressions; missing validation for parts (?)
18     CSS - parser doesn't accept advanced CSS (fringe)
19     Number - constructor interface inconsistent with Integer
20 Strategy
21     FixNesting - cannot bubble nodes out of structures, duplicated checks
22         for special-case parent node
23     RemoveForeignElements - should be run in parallel with MakeWellFormed
24 URIScheme - needs to have callable generic checks
25     mailto - doesn't validate emails, doesn't validate querystring
26     news - doesn't validate opaque path
27     nntp - doesn't constrain path
29     vim: et sw=4 sts=4