Closed Bug 1299436 Opened 4 years ago Closed 1 year ago

Detect identical branches in if statements

Categories

(Firefox Build System :: Source Code Analysis, defect, P5)

defect

Tracking

(firefox51 affected)

RESOLVED WONTFIX
Tracking Status
firefox51 --- affected

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

I think we should implement this checker in our clang based static analysis tool, basically we need to assert to the engineer an error when statement like this kind are detected:

>>if (i < 2) {
>>	callAFunction();
>>} else {
>>	callAFunction();
>>}

extending this example to a more generic one we should be able to detect statements like:

>>if (<Logical Expression>) {
>>	<statements if>
>>} else {
>>	<statements else>
>>}

where <statements if> should be equal to <statements else>
Priority: -- → P5
Product: Core → Firefox Build System
Coverity gots it.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.