Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-709

Rule: Duplicate conditions in "if" and related "else if"

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: C, C++, Objective-C, Rules
    • Labels:
      None

      Description

      According to http://www.viva64.com/en/examples/V517/ this is pretty common mistake even in serious projects. Also seems that it is available or was available in cppcheck as "duplicateIf".

      And should be noted that standard duplication detection mechanism of SQ will not detect such cases, because of a size.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                evgeny.mandrikov Evgeny Mandrikov
                Reporter:
                evgeny.mandrikov Evgeny Mandrikov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: