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