Release 1.6.1, merged in 931 to HEAD.
[htmlpurifier.git] / docs / dev-code-quality.txt
blob7c09a22cb050b11e251dea4fb3a473528cdf3c58
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
15         expressions
16     Lang - code duplication; premature optimization
17     Length - easily mistaken for CSSLength
18     URI - multiple regular expressions; missing validation for parts (?)
19     CSS - parser doesn't accept advanced CSS (fringe)
20     Number - constructor interface inconsistent with Integer
21 ConfigSchema - redefinition is a mess
22 Strategy
23     FixNesting - cannot bubble nodes out of structures, duplicated checks
24         for special-case parent node
25     MakeWellFormed - insufficient automatic closing definitions (check HTML
26         spec for optional end tags, also, closing based on type (block/inline)
27         might be efficient).
28     RemoveForeignElements - should be run in parallel with MakeWellFormed
29 URIScheme - needs to have callable generic checks
30     mailto - doesn't validate emails, doesn't validate querystring
31     news - doesn't validate opaque path
32     nntp - doesn't constrain path