Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
New Check: ConfusingConditionCheck #90
from PMD http://pmd.sourceforge.net/pmd-5.0.0/rules/index.html:
we just give idea from PMD, we have the constant problem in code - so we need to automate it a bit at least as in PMD.
Lets split task in two stages: simple Check for "!=" detection and advanced check to detect more complicated conditions. I am not 100% sure in success of second stage so lets finish+test first part and then try to do second in separate branch.
In case it is ternary(http://en.wikipedia.org/wiki/%3F:), we could require modification (see "discrete math" for details, http://en.wikipedia.org/wiki/De_Morgan%27s_laws):